@eslinted/core 0.8.0-rc.0 → 0.8.0-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/boundary/boundary.d.ts +2 -2
- package/dist/boundary/boundary.d.ts.map +1 -1
- package/dist/boundary/input/plugins/plugins.d.ts +1 -1
- package/dist/boundary/input/plugins/plugins.d.ts.map +1 -1
- package/dist/boundary/output/config/IConfig.d.ts +1 -1
- package/dist/boundary/output/config/IConfig.d.ts.map +1 -1
- package/dist/factory/options/option/Option.d.ts +6 -4
- package/dist/factory/options/option/Option.d.ts.map +1 -1
- package/dist/factory/options/option/Option.js +23 -4
- package/dist/factory/options/option/Option.js.map +1 -1
- package/dist/factory/options/option/html/index.d.ts +1 -1
- package/dist/factory/options/option/html/index.d.ts.map +1 -1
- package/dist/factory/options/option/html/index.js +1 -1
- package/dist/factory/options/option/html/index.js.map +1 -1
- package/dist/factory/options/option/js/index.d.ts +1 -1
- package/dist/factory/options/option/js/index.d.ts.map +1 -1
- package/dist/factory/options/option/js/index.js +1 -1
- package/dist/factory/options/option/js/index.js.map +1 -1
- package/dist/factory/options/option/json/index.d.ts +1 -1
- package/dist/factory/options/option/json/index.d.ts.map +1 -1
- package/dist/factory/options/option/json/index.js +1 -1
- package/dist/factory/options/option/json/index.js.map +1 -1
- package/dist/factory/options/option/jsonc/index.d.ts +1 -1
- package/dist/factory/options/option/jsonc/index.d.ts.map +1 -1
- package/dist/factory/options/option/jsonc/index.js +1 -1
- package/dist/factory/options/option/jsonc/index.js.map +1 -1
- package/dist/factory/options/option/svelte/index.d.ts +1 -1
- package/dist/factory/options/option/svelte/index.d.ts.map +1 -1
- package/dist/factory/options/option/svelte/index.js +1 -1
- package/dist/factory/options/option/svelte/index.js.map +1 -1
- package/dist/factory/options/option/ts/index.d.ts +1 -1
- package/dist/factory/options/option/ts/index.d.ts.map +1 -1
- package/dist/factory/options/option/ts/index.js +1 -1
- package/dist/factory/options/option/ts/index.js.map +1 -1
- package/dist/factory/options/option/yml/index.d.ts +1 -1
- package/dist/factory/options/option/yml/index.d.ts.map +1 -1
- package/dist/factory/options/option/yml/index.js +1 -1
- package/dist/factory/options/option/yml/index.js.map +1 -1
- package/dist/factory/ruleset/Ruleset.d.ts +8 -7
- package/dist/factory/ruleset/Ruleset.d.ts.map +1 -1
- package/dist/factory/ruleset/Ruleset.js +13 -12
- package/dist/factory/ruleset/Ruleset.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/boundary/boundary.ts +2 -2
- package/src/boundary/input/plugins/plugins.ts +1 -1
- package/src/boundary/output/config/IConfig.ts +1 -1
- package/src/boundary/output/config/interface/option/IOption.d.ts +0 -3
- package/src/factory/options/option/Option.ts +37 -6
- package/src/factory/options/option/html/index.ts +1 -1
- package/src/factory/options/option/js/index.ts +1 -1
- package/src/factory/options/option/json/index.ts +1 -1
- package/src/factory/options/option/jsonc/index.ts +1 -1
- package/src/factory/options/option/svelte/index.ts +1 -1
- package/src/factory/options/option/ts/index.ts +1 -1
- package/src/factory/options/option/yml/index.ts +1 -1
- package/src/factory/ruleset/Ruleset.ts +18 -18
- package/src/index.ts +19 -25
- package/types/project/OmitFilesRuleset.d.ts +1 -0
- package/src/boundary/output/config/interface/option/name/IOName.d.ts +0 -1
- package/types/project/OmitLast.d.ts +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
import scopes, { type Scope } from "./scopes/scopes.js";
|
2
2
|
import type { Plugins, Parsers } from "./input/input.js";
|
3
|
-
import type
|
3
|
+
import type IConfig from "./output/output.js";
|
4
4
|
export default scopes;
|
5
|
-
export type { Scope, Plugins, Parsers,
|
5
|
+
export type { Scope, Plugins, Parsers, IConfig, };
|
6
6
|
//# sourceMappingURL=boundary.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"boundary.d.ts","sourceRoot":"","sources":["../../src/boundary/boundary.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"boundary.d.ts","sourceRoot":"","sources":["../../src/boundary/boundary.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,eAAe,MAAM,CAAC;AACtB,YAAY,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,GACR,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Scope, Options } from "../../../factory/Factory.js";
|
2
2
|
type Plugins = {
|
3
|
-
[S in Scope]: InstanceType<typeof Options[S]>["plugins"];
|
3
|
+
readonly [S in Scope]: InstanceType<typeof Options[S]>["plugins"];
|
4
4
|
};
|
5
5
|
export type { Plugins as default };
|
6
6
|
//# sourceMappingURL=plugins.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../src/boundary/input/plugins/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAElE,KAAK,OAAO,GAAG;
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../src/boundary/input/plugins/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAElE,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,CAAC,IAAI,KAAK,GAAG,YAAY,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;CAClE,CAAC;AAEF,YAAY,EAAE,OAAO,IAAI,OAAO,EAAE,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"IConfig.d.ts","sourceRoot":"","sources":["../../../../src/boundary/output/config/IConfig.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,OAAO;IAC9B,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;
|
1
|
+
{"version":3,"file":"IConfig.d.ts","sourceRoot":"","sources":["../../../../src/boundary/output/config/IConfig.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,OAAO;IAC9B,IAAI,EAAE,SAAS,MAAM,SAAS,MAAM,IAAI,MAAM,EAAE,CAAC;IACjD,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE;QACb,cAAc,EAAE,IAAI,CAAC;QACrB,6BAA6B,EAAE,OAAO,CAAC;KACxC,CAAC;IACF,eAAe,EAAE;QACf,UAAU,CAAC,EACP,QAAQ,GACR,QAAQ,CAAC;QACb,WAAW,CAAC,EAAE,QAAQ,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACzC,CAAC;IACF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
@@ -1,20 +1,22 @@
|
|
1
1
|
import type { Scope } from "../Options.js";
|
2
|
+
import type { Ruleset } from "../../Factory.js";
|
3
|
+
import type { IConfig } from "../../../boundary/boundary.js";
|
2
4
|
export default abstract class Option<S extends Scope, PluginId extends string, IsEcma extends boolean = true, ParserOptions extends object | boolean = false, ParserCount extends 0 | 1 | 2 = 0, GlobalTypes extends string = never, Processor extends object = never> {
|
3
5
|
readonly files: readonly string[];
|
6
|
+
readonly ruleset: Ruleset<S>;
|
4
7
|
readonly plugins: IOPlugins<PluginId>;
|
5
8
|
readonly parser: Tuple<unknown, ParserCount>;
|
6
9
|
readonly linterOptions: {
|
7
10
|
readonly noInlineConfig: true;
|
8
11
|
readonly reportUnusedDisableDirectives: "error";
|
9
12
|
};
|
10
|
-
abstract readonly
|
13
|
+
abstract readonly scope: literalful<S>;
|
11
14
|
abstract readonly processor: (Interface<Processor> extends never ? object : Interface<Processor> extends {
|
12
15
|
"interface": string;
|
13
16
|
} ? Interface<Processor> : object);
|
14
|
-
constructor(files: readonly string[], plugins: IOPlugins<PluginId>, parser: Tuple<unknown, ParserCount>);
|
17
|
+
constructor(files: readonly string[], ruleset: Ruleset<S>, plugins: IOPlugins<PluginId>, parser: Tuple<unknown, ParserCount>);
|
18
|
+
get configs(): IConfig[];
|
15
19
|
get option(): {
|
16
|
-
name: literalful<`scope:${S}`>;
|
17
|
-
files: readonly string[];
|
18
20
|
linterOptions: {
|
19
21
|
readonly noInlineConfig: true;
|
20
22
|
readonly reportUnusedDisableDirectives: "error";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/option/Option.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/option/Option.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,MAAM,CAClC,CAAC,SAAS,KA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
reportUnusedDisableDirectives: "error",
|
8
9
|
};
|
9
|
-
constructor(files, plugins, parser) {
|
10
|
+
constructor(files, ruleset, plugins, parser) {
|
10
11
|
this.files = files;
|
12
|
+
this.ruleset = ruleset;
|
11
13
|
this.plugins = plugins;
|
12
14
|
this.parser = parser;
|
13
15
|
}
|
16
|
+
get configs() {
|
17
|
+
const { scope, ruleset, files, option, } = this;
|
18
|
+
if (ruleset.id !== scope)
|
19
|
+
throw new TypeError(`Option and Ruleset scope mismatch`, { cause: { option: scope, ruleset: ruleset.id } });
|
20
|
+
else if (files.length < 1)
|
21
|
+
return [];
|
22
|
+
else {
|
23
|
+
const baseName = `scope:${scope}/rule:${ruleset.id}`;
|
24
|
+
return ruleset.records.map(([ruleId, rules]) => {
|
25
|
+
const name = `${baseName}+${ruleId}`;
|
26
|
+
return {
|
27
|
+
name,
|
28
|
+
files,
|
29
|
+
rules,
|
30
|
+
...option,
|
31
|
+
};
|
32
|
+
});
|
33
|
+
}
|
34
|
+
}
|
14
35
|
get option() {
|
15
|
-
const {
|
36
|
+
const { plugins, linterOptions, languageOptions, processor, } = this;
|
16
37
|
return {
|
17
|
-
name,
|
18
|
-
files,
|
19
38
|
linterOptions,
|
20
39
|
languageOptions,
|
21
40
|
plugins,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Option.js","sourceRoot":"","sources":["../../../../src/factory/options/option/Option.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"Option.js","sourceRoot":"","sources":["../../../../src/factory/options/option/Option.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,OAAgB,MAAM;IAkBhB;IACA;IACA;IACA;IAZF,aAAa,GAAG;QAC9B,cAAc,EAAE,IAAI;QACpB,6BAA6B,EAAE,OAAO;KAC9B,CAAC;IAKX,YACkB,KAAwB,EACxB,OAAmB,EACnB,OAA4B,EAC5B,MAAmC;QAHnC,UAAK,GAAL,KAAK,CAAmB;QACxB,YAAO,GAAP,OAAO,CAAY;QACnB,YAAO,GAAP,OAAO,CAAqB;QAC5B,WAAM,GAAN,MAAM,CAA6B;IAClD,CAAC;IAEJ,IAAW,OAAO;QAChB,MAAM,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EACL,MAAM,GACP,GAAG,IAAI,CAAC;QAET,IAAI,OAAO,CAAC,EAAE,KAAK,KAAK;YACtB,MAAM,IAAI,SAAS,CACjB,mCAAmC,EACnC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,CAClD,CAAC;aACC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YACvB,OAAO,EAAE,CAAC;aACP,CAAC;YACJ,MAAM,QAAQ,GAAG,SAAS,KAAK,SAAS,OAAO,CAAC,EAAE,EAAW,CAAC;YAE9D,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CACxB,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE;gBAClB,MAAM,IAAI,GAAG,GAAG,QAAQ,IAAI,MAAM,EAAW,CAAC;gBAE9C,OAAO;oBACL,IAAI;oBACJ,KAAK;oBACL,KAAK;oBACL,GAAG,MAAM;iBACV,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAW,MAAM;QACf,MAAM,EACJ,OAAO,EACP,aAAa,EACb,eAAe,EACf,SAAS,GACV,GAAG,IAAI,CAAC;QAET,OAAO;YACL,aAAa;YACb,eAAe;YACf,OAAO;YACP,GAAG,SAAS;SAOb,CAAC;IACJ,CAAC;CAOF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/html/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,cAAc,EACd,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/html/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,cAAc,EACd,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,KAAK,UAAU;IAC/B,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/html/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAMvC;IACiB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/html/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAMvC;IACiB,KAAK,GAAG,MAAM,CAAC;IACf,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/js/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;IAC9D,SAAgB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/js/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;IAC9D,SAAgB,KAAK,QAAQ;IAC7B,SAAgB,SAAS,KAAM;IAE/B,IAAW,eAAe;;;MAKzB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/js/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAA0B;IAC9C,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/js/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAA0B;IAC9C,KAAK,GAAG,IAAI,CAAC;IACb,SAAS,GAAG,EAAE,CAAC;IAE/B,IAAW,eAAe;QACxB,OAAO;YACL,WAAW,EAAE,QAAQ;YACrB,UAAU,EAAE,QAAQ;SACZ,CAAC;IACb,CAAC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,OAAO,EACP,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,OAAO,EACP,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,KAAK,UAAU;IAC/B,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAMvC;IACiB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAMvC;IACiB,KAAK,GAAG,MAAM,CAAC;IACf,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/jsonc/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM,CAC7C,OAAO,EACP,OAAO,EACP,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/jsonc/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM,CAC7C,OAAO,EACP,OAAO,EACP,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,KAAK,WAAW;IAChC,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/jsonc/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAMxC;IACiB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/jsonc/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAMxC;IACiB,KAAK,GAAG,OAAO,CAAC;IAChB,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
|
@@ -7,7 +7,7 @@ export default class SvelteOption extends Option<"svelte", "svelte" | keyof TsOp
|
|
7
7
|
}, 2, never, {
|
8
8
|
processor: "svelte/svelte";
|
9
9
|
}> {
|
10
|
-
readonly
|
10
|
+
readonly scope = "svelte";
|
11
11
|
readonly processor: {
|
12
12
|
readonly processor: "svelte/svelte";
|
13
13
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/svelte/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAAM,CAC9C,QAAQ,EACR,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAC9C,IAAI,EACF,QAAQ,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,eAAe,CAAC,GACtD;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,mBAAmB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,EAC/C,CAAC,EACD,KAAK,EACL;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE,CAC/B;IACC,SAAgB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/svelte/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAAM,CAC9C,QAAQ,EACR,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAC9C,IAAI,EACF,QAAQ,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,eAAe,CAAC,GACtD;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,mBAAmB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,EAC/C,CAAC,EACD,KAAK,EACL;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE,CAC/B;IACC,SAAgB,KAAK,YAAY;IACjC,SAAgB,SAAS;;MAA2C;IAEpE,IAAW,eAAe;;;;;;;;;;;MAezB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/svelte/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAGlC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAUzC;IACiB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/svelte/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAGlC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAUzC;IACiB,KAAK,GAAG,QAAQ,CAAC;IACjB,SAAS,GAAG,EAAE,SAAS,EAAE,eAAe,EAAW,CAAC;IAEpE,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAEvC,OAAO;YACL,WAAW,EAAE,QAAQ;YACrB,UAAU,EAAE,QAAQ;YACpB,MAAM;YACN,aAAa,EAAE;gBACb,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,eAAe;gBACxB,mBAAmB,EAAE,CAAC,SAAS,CAAU;gBACzC,MAAM,EAAE,QAAQ;aACjB;SACO,CAAC;IACb,CAAC;CACF"}
|
@@ -3,7 +3,7 @@ import type JsOption from "../js/index.js";
|
|
3
3
|
export default class TsOption extends Option<"ts", "@typescript-eslint" | keyof JsOption["option"]["plugins"], true, JsOption["option"]["languageOptions"] & {
|
4
4
|
project: "tsconfig.json";
|
5
5
|
}, 1> {
|
6
|
-
readonly
|
6
|
+
readonly scope = "ts";
|
7
7
|
readonly processor: {};
|
8
8
|
get languageOptions(): {
|
9
9
|
readonly ecmaVersion: "latest";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAC1C,IAAI,EACJ,oBAAoB,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAC1D,IAAI,EACF,QAAQ,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,GACrC;IAAE,OAAO,EAAE,eAAe,CAAA;CAAE,EAC9B,CAAC,CACF;IACC,SAAgB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAC1C,IAAI,EACJ,oBAAoB,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAC1D,IAAI,EACF,QAAQ,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,GACrC;IAAE,OAAO,EAAE,eAAe,CAAA;CAAE,EAC9B,CAAC,CACF;IACC,SAAgB,KAAK,QAAQ;IAC7B,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;;;;;;;;MAazB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAGlC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAOrC;IACiB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAGlC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAOrC;IACiB,KAAK,GAAG,IAAI,CAAC;IACb,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO;YACL,WAAW,EAAE,QAAQ;YACrB,UAAU,EAAE,QAAQ;YACpB,MAAM;YACN,aAAa,EAAE;gBACb,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,eAAe;aACzB;SACO,CAAC;IACb,CAAC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/yml/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAAM,CAC3C,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/yml/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAAM,CAC3C,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,KAAK,SAAS;IAC9B,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/yml/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAMtC;IACiB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/yml/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAMtC;IACiB,KAAK,GAAG,KAAK,CAAC;IACd,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import Rule from "./rule/Rule.js";
|
2
|
+
import type { Scope } from "../Factory.js";
|
2
3
|
export { Rule };
|
3
|
-
export default class Ruleset<
|
4
|
-
readonly
|
4
|
+
export default class Ruleset<S extends Scope> {
|
5
|
+
private readonly scope;
|
5
6
|
readonly ruleset: readonly Rule[];
|
6
|
-
|
7
|
-
constructor(
|
8
|
-
get id():
|
9
|
-
get
|
10
|
-
override(
|
7
|
+
overrides: Null<Rule>;
|
8
|
+
constructor(scope: literalful<S>, ...ruleset: readonly Rule[]);
|
9
|
+
get id(): literalful<S>;
|
10
|
+
get records(): (readonly [string, IRule])[];
|
11
|
+
override(overrides: undefined | IRule): this;
|
11
12
|
}
|
12
13
|
//# sourceMappingURL=Ruleset.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Ruleset.d.ts","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"Ruleset.d.ts","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,CAAC,SAAS,KAAK;IAKxC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJxB,SAAgB,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;IAClC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAQ;gBAGjB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACrC,GAAG,OAAO,EAAE,SAAS,IAAI,EAAE;IAK7B,IAAW,EAAE,kBAIZ;IAED,IAAW,OAAO,iCAOjB;IAEM,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,KAAK;CAS7C"}
|
@@ -1,26 +1,27 @@
|
|
1
1
|
import Rule from "./rule/Rule.js";
|
2
2
|
export { Rule };
|
3
3
|
export default class Ruleset {
|
4
|
-
|
4
|
+
scope;
|
5
5
|
ruleset;
|
6
|
-
overrides =
|
7
|
-
constructor(
|
8
|
-
this.
|
6
|
+
overrides = null;
|
7
|
+
constructor(scope, ...ruleset) {
|
8
|
+
this.scope = scope;
|
9
9
|
this.ruleset = [...ruleset];
|
10
10
|
}
|
11
11
|
get id() {
|
12
|
-
|
12
|
+
const { scope } = this;
|
13
|
+
return scope;
|
13
14
|
}
|
14
|
-
get
|
15
|
+
get records() {
|
16
|
+
const { ruleset, overrides } = this;
|
15
17
|
return [
|
16
|
-
...
|
17
|
-
...
|
18
|
+
...ruleset.map(rules => [rules.id, rules.rules]),
|
19
|
+
...overrides === null ? [] : [[overrides.id, overrides.rules]],
|
18
20
|
];
|
19
21
|
}
|
20
|
-
override(
|
21
|
-
|
22
|
-
.
|
23
|
-
.map(override => new Rule("override", override)));
|
22
|
+
override(overrides) {
|
23
|
+
if (typeof overrides !== "undefined")
|
24
|
+
this.overrides = new Rule("override", overrides);
|
24
25
|
return this;
|
25
26
|
}
|
26
27
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Ruleset.js","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"Ruleset.js","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAGlC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO;IAKP;IAJH,OAAO,CAAkB;IAClC,SAAS,GAAe,IAAI,CAAC;IAEpC,YACmB,KAAoB,EACrC,GAAG,OAAwB;QADV,UAAK,GAAL,KAAK,CAAe;QAGrC,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,IAAW,EAAE;QACX,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAW,OAAO;QAChB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAEpC,OAAO;YACL,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAU,CAAC;YACzD,GAAG,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,KAAK,CAAU,CAAU;SACjF,CAAC;IACJ,CAAC;IAEM,QAAQ,CAAC,SAA4B;QAC1C,IAAI,OAAO,SAAS,KAAK,WAAW;YAClC,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CACvB,UAAU,EACV,SAAS,CACV,CAAC;QAEJ,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import type { Scope, Plugins, Parsers,
|
1
|
+
import type { Scope, Plugins, Parsers, IConfig } from "./boundary/boundary.js";
|
2
2
|
import { Ruleset, Rule } from "./factory/Factory.js";
|
3
3
|
export type { Scope };
|
4
4
|
export { Ruleset, Rule };
|
5
5
|
export default function (plugins: Plugins, parsers: Parsers, base: Record<Scope, string[]>, includes: Particord<Scope, string[]>, rulesets: {
|
6
6
|
[S in Scope]: Ruleset<S>;
|
7
|
-
}, overrides: Particord<Scope, IRule>):
|
7
|
+
}, overrides: Particord<Scope, IRule>): IConfig[];
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACP,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,EACR,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,OAAO,EACP,IAAI,EACL,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,KAAK,EAAE,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACzB,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAC7B,QAAQ,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EACpC,QAAQ,EAAE;KAAG,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC;CAAE,EACtC,SAAS,EAAE,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,GACjC,OAAO,EAAE,CA0FX"}
|
package/dist/index.js
CHANGED
@@ -19,38 +19,29 @@ export default function (plugins, parsers, base, includes, rulesets, overrides)
|
|
19
19
|
rulesets[scope].override(overrides[scope]);
|
20
20
|
const options = {
|
21
21
|
js: new Options
|
22
|
-
.js(files.files("js"), ...imports.js)
|
23
|
-
.
|
22
|
+
.js(files.files("js"), rulesets.js, ...imports.js)
|
23
|
+
.configs,
|
24
24
|
ts: new Options
|
25
|
-
.ts(files.files("ts"), ...imports.ts)
|
26
|
-
.
|
25
|
+
.ts(files.files("ts"), rulesets.ts, ...imports.ts)
|
26
|
+
.configs,
|
27
27
|
svelte: new Options
|
28
|
-
.svelte(files.files("svelte"), ...imports.svelte)
|
29
|
-
.
|
28
|
+
.svelte(files.files("svelte"), rulesets.svelte, ...imports.svelte)
|
29
|
+
.configs,
|
30
30
|
html: new Options
|
31
|
-
.html(files.files("html"), ...imports.html)
|
32
|
-
.
|
31
|
+
.html(files.files("html"), rulesets.html, ...imports.html)
|
32
|
+
.configs,
|
33
33
|
json: new Options
|
34
|
-
.json(files.files("json"), ...imports.json)
|
35
|
-
.
|
34
|
+
.json(files.files("json"), rulesets.json, ...imports.json)
|
35
|
+
.configs,
|
36
36
|
jsonc: new Options
|
37
|
-
.jsonc(files.files("jsonc"), ...imports.jsonc)
|
38
|
-
.
|
37
|
+
.jsonc(files.files("jsonc"), rulesets.jsonc, ...imports.jsonc)
|
38
|
+
.configs,
|
39
39
|
yml: new Options
|
40
|
-
.yml(files.files("yml"), ...imports.yml)
|
41
|
-
.
|
40
|
+
.yml(files.files("yml"), rulesets.yml, ...imports.yml)
|
41
|
+
.configs,
|
42
42
|
};
|
43
43
|
return scopes
|
44
|
-
.map(scope => options[scope]
|
45
|
-
? rulesets[scope]
|
46
|
-
.flat
|
47
|
-
.map(rules => {
|
48
|
-
return {
|
49
|
-
rules,
|
50
|
-
...options[scope],
|
51
|
-
};
|
52
|
-
})
|
53
|
-
: [])
|
44
|
+
.map(scope => options[scope])
|
54
45
|
.flat();
|
55
46
|
}
|
56
47
|
catch (e) {
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAO5C,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,GACL,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACzB,MAAM,CAAC,OAAO,WACZ,OAAgB,EAChB,OAAgB,EAChB,IAA6B,EAC7B,QAAoC,EACpC,QAAsC,EACtC,SAAkC;IAElC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,IAAI,EACJ,QAAQ,CACT,EACD,OAAO,GAEH;YACF,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAU;YAC7B,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAU;YACv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,EACnB,QAAQ,CAAC,IAAI,EACb,GAAG,OAAO,CAAC,IAAI,CAChB;iBACA,OAAO;YACV,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EACnB,QAAQ,CAAC,IAAI,EACb,GAAG,OAAO,CAAC,IAAI,CAChB;iBACA,OAAO;YACV,KAAK,EAAE,IAAI,OAAO;iBACf,KAAK,CACJ,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EACpB,QAAQ,CAAC,KAAK,EACd,GAAG,OAAO,CAAC,KAAK,CACjB;iBACA,OAAO;YACV,GAAG,EAAE,IAAI,OAAO;iBACb,GAAG,CACF,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAClB,QAAQ,CAAC,GAAG,EACZ,GAAG,OAAO,CAAC,GAAG,CACf;iBACA,OAAO;SACX,CAAC;QAEF,OAAO,MAAM;aACV,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;aAC5B,IAAI,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,6BAA6B,EAC7B,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
package/src/boundary/boundary.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import scopes, { type Scope } from "./scopes/scopes.js";
|
2
2
|
import type { Plugins, Parsers } from "./input/input.js";
|
3
|
-
import type
|
3
|
+
import type IConfig from "./output/output.js";
|
4
4
|
|
5
5
|
export default scopes;
|
6
6
|
export type {
|
7
7
|
Scope,
|
8
8
|
Plugins,
|
9
9
|
Parsers,
|
10
|
-
|
10
|
+
IConfig,
|
11
11
|
};
|
@@ -1,5 +1,4 @@
|
|
1
1
|
declare type IOption<
|
2
|
-
Name extends string,
|
3
2
|
PluginId extends string,
|
4
3
|
IsEcma extends boolean,
|
5
4
|
ParserOptions extends object | boolean,
|
@@ -7,8 +6,6 @@ declare type IOption<
|
|
7
6
|
Processor extends object,
|
8
7
|
> =
|
9
8
|
{
|
10
|
-
name: IOName<Name>;
|
11
|
-
files: readonly string[];
|
12
9
|
linterOptions: IOLinter;
|
13
10
|
languageOptions: IOLanguage<
|
14
11
|
IsEcma,
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import type { Scope } from "../Options.js";
|
2
|
+
import type { Ruleset } from "../../Factory.js";
|
3
|
+
import type { IConfig } from "../../../boundary/boundary.js";
|
2
4
|
|
3
5
|
export default abstract class Option<
|
4
6
|
S extends Scope,
|
@@ -14,19 +16,51 @@ export default abstract class Option<
|
|
14
16
|
reportUnusedDisableDirectives: "error",
|
15
17
|
} as const;
|
16
18
|
|
17
|
-
public abstract readonly
|
19
|
+
public abstract readonly scope: literalful<S>;
|
18
20
|
public abstract readonly processor: (Interface<Processor> extends never ? object : Interface<Processor> extends { "interface": string } ? Interface<Processor> : object);
|
19
21
|
|
20
22
|
constructor(
|
21
23
|
public readonly files: readonly string[],
|
24
|
+
public readonly ruleset: Ruleset<S>,
|
22
25
|
public readonly plugins: IOPlugins<PluginId>,
|
23
26
|
public readonly parser: Tuple<unknown, ParserCount>,
|
24
27
|
) {}
|
25
28
|
|
26
|
-
public get
|
29
|
+
public get configs(): IConfig[] {
|
27
30
|
const {
|
28
|
-
|
31
|
+
scope,
|
32
|
+
ruleset,
|
29
33
|
files,
|
34
|
+
option,
|
35
|
+
} = this;
|
36
|
+
|
37
|
+
if (ruleset.id !== scope)
|
38
|
+
throw new TypeError(
|
39
|
+
`Option and Ruleset scope mismatch`,
|
40
|
+
{ cause: { option: scope, ruleset: ruleset.id } },
|
41
|
+
);
|
42
|
+
else if (files.length < 1)
|
43
|
+
return [];
|
44
|
+
else {
|
45
|
+
const baseName = `scope:${scope}/rule:${ruleset.id}` as const;
|
46
|
+
|
47
|
+
return ruleset.records.map(
|
48
|
+
([ruleId, rules]) => {
|
49
|
+
const name = `${baseName}+${ruleId}` as const;
|
50
|
+
|
51
|
+
return {
|
52
|
+
name,
|
53
|
+
files,
|
54
|
+
rules,
|
55
|
+
...option,
|
56
|
+
};
|
57
|
+
},
|
58
|
+
);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
public get option() {
|
63
|
+
const {
|
30
64
|
plugins,
|
31
65
|
linterOptions,
|
32
66
|
languageOptions,
|
@@ -34,14 +68,11 @@ export default abstract class Option<
|
|
34
68
|
} = this;
|
35
69
|
|
36
70
|
return {
|
37
|
-
name,
|
38
|
-
files,
|
39
71
|
linterOptions,
|
40
72
|
languageOptions,
|
41
73
|
plugins,
|
42
74
|
...processor,
|
43
75
|
} satisfies IOption<
|
44
|
-
`scope:${S}`,
|
45
76
|
PluginId,
|
46
77
|
IsEcma,
|
47
78
|
ParserOptions,
|
@@ -12,7 +12,7 @@ export default class SvelteOption extends Option<
|
|
12
12
|
never,
|
13
13
|
{ processor: "svelte/svelte" }
|
14
14
|
> {
|
15
|
-
public readonly
|
15
|
+
public readonly scope = "svelte";
|
16
16
|
public readonly processor = { processor: "svelte/svelte" } as const;
|
17
17
|
|
18
18
|
public get languageOptions() {
|
@@ -1,39 +1,39 @@
|
|
1
1
|
import Rule from "./rule/Rule.js";
|
2
|
+
import type { Scope } from "../Factory.js";
|
2
3
|
|
3
4
|
export { Rule };
|
4
|
-
export default class Ruleset<
|
5
|
+
export default class Ruleset<S extends Scope> {
|
5
6
|
public readonly ruleset: readonly Rule[];
|
6
|
-
public
|
7
|
+
public overrides: Null<Rule> = null;
|
7
8
|
|
8
9
|
constructor(
|
9
|
-
|
10
|
+
private readonly scope: literalful<S>,
|
10
11
|
...ruleset: readonly Rule[]
|
11
12
|
) {
|
12
13
|
this.ruleset = [...ruleset];
|
13
14
|
}
|
14
15
|
|
15
16
|
public get id() {
|
16
|
-
|
17
|
+
const { scope } = this;
|
18
|
+
|
19
|
+
return scope;
|
17
20
|
}
|
18
21
|
|
19
|
-
public get
|
22
|
+
public get records() {
|
23
|
+
const { ruleset, overrides } = this;
|
24
|
+
|
20
25
|
return [
|
21
|
-
...
|
22
|
-
...
|
26
|
+
...ruleset.map(rules => [rules.id, rules.rules] as const),
|
27
|
+
...overrides === null ? [] : [[overrides.id, overrides.rules] as const] as const,
|
23
28
|
];
|
24
29
|
}
|
25
30
|
|
26
|
-
public override(
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
"override",
|
33
|
-
override,
|
34
|
-
),
|
35
|
-
),
|
36
|
-
);
|
31
|
+
public override(overrides: undefined | IRule) {
|
32
|
+
if (typeof overrides !== "undefined")
|
33
|
+
this.overrides = new Rule(
|
34
|
+
"override",
|
35
|
+
overrides,
|
36
|
+
);
|
37
37
|
|
38
38
|
return this;
|
39
39
|
}
|
package/src/index.ts
CHANGED
@@ -3,7 +3,7 @@ import type {
|
|
3
3
|
Scope,
|
4
4
|
Plugins,
|
5
5
|
Parsers,
|
6
|
-
|
6
|
+
IConfig,
|
7
7
|
} from "./boundary/boundary.js";
|
8
8
|
import {
|
9
9
|
Options,
|
@@ -21,14 +21,14 @@ export default function (
|
|
21
21
|
includes: Particord<Scope, string[]>,
|
22
22
|
rulesets: { [S in Scope]: Ruleset<S> },
|
23
23
|
overrides: Particord<Scope, IRule>,
|
24
|
-
):
|
24
|
+
): IConfig[] {
|
25
25
|
try {
|
26
26
|
const files = new Files(
|
27
27
|
base,
|
28
28
|
includes,
|
29
29
|
),
|
30
30
|
imports: {
|
31
|
-
[S in Scope]:
|
31
|
+
[S in Scope]: OmitFilesRuleset<ConstructorParameters<typeof Options[S]>>;
|
32
32
|
} = {
|
33
33
|
js: [plugins.js, []] as const,
|
34
34
|
ts: [plugins.ts, [parsers.ts]] as const,
|
@@ -48,67 +48,61 @@ export default function (
|
|
48
48
|
const options: {
|
49
49
|
[S in Scope]: InstanceType<
|
50
50
|
typeof Options[S]
|
51
|
-
>["
|
51
|
+
>["configs"]
|
52
52
|
} = {
|
53
53
|
js: new Options
|
54
54
|
.js(
|
55
55
|
files.files("js"),
|
56
|
+
rulesets.js,
|
56
57
|
...imports.js,
|
57
58
|
)
|
58
|
-
.
|
59
|
+
.configs,
|
59
60
|
ts: new Options
|
60
61
|
.ts(
|
61
62
|
files.files("ts"),
|
63
|
+
rulesets.ts,
|
62
64
|
...imports.ts,
|
63
65
|
)
|
64
|
-
.
|
66
|
+
.configs,
|
65
67
|
svelte: new Options
|
66
68
|
.svelte(
|
67
69
|
files.files("svelte"),
|
70
|
+
rulesets.svelte,
|
68
71
|
...imports.svelte,
|
69
72
|
)
|
70
|
-
.
|
73
|
+
.configs,
|
71
74
|
html: new Options
|
72
75
|
.html(
|
73
76
|
files.files("html"),
|
77
|
+
rulesets.html,
|
74
78
|
...imports.html,
|
75
79
|
)
|
76
|
-
.
|
80
|
+
.configs,
|
77
81
|
json: new Options
|
78
82
|
.json(
|
79
83
|
files.files("json"),
|
84
|
+
rulesets.json,
|
80
85
|
...imports.json,
|
81
86
|
)
|
82
|
-
.
|
87
|
+
.configs,
|
83
88
|
jsonc: new Options
|
84
89
|
.jsonc(
|
85
90
|
files.files("jsonc"),
|
91
|
+
rulesets.jsonc,
|
86
92
|
...imports.jsonc,
|
87
93
|
)
|
88
|
-
.
|
94
|
+
.configs,
|
89
95
|
yml: new Options
|
90
96
|
.yml(
|
91
97
|
files.files("yml"),
|
98
|
+
rulesets.yml,
|
92
99
|
...imports.yml,
|
93
100
|
)
|
94
|
-
.
|
101
|
+
.configs,
|
95
102
|
};
|
96
103
|
|
97
104
|
return scopes
|
98
|
-
.map(
|
99
|
-
scope => options[scope].files.length > 0
|
100
|
-
? rulesets[scope]
|
101
|
-
.flat
|
102
|
-
.map(
|
103
|
-
rules => {
|
104
|
-
return {
|
105
|
-
rules,
|
106
|
-
...options[scope],
|
107
|
-
};
|
108
|
-
},
|
109
|
-
)
|
110
|
-
: [],
|
111
|
-
)
|
105
|
+
.map(scope => options[scope])
|
112
106
|
.flat();
|
113
107
|
}
|
114
108
|
catch (e) {
|
@@ -0,0 +1 @@
|
|
1
|
+
declare type OmitFilesRuleset<A> = A extends readonly [unknown, unknown, ...infer An_1] ? An_1 : never;
|
@@ -1 +0,0 @@
|
|
1
|
-
declare type IOName<Name extends string> = literalful<Name>;
|
@@ -1 +0,0 @@
|
|
1
|
-
declare type OmitFirst<A> = A extends readonly [unknown, ...infer An_1] ? An_1 : never;
|