@eslinted/core 0.5.1 → 0.7.0-rc.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/boundary/boundary.d.ts +6 -0
- package/dist/boundary/boundary.d.ts.map +1 -0
- package/dist/boundary/boundary.js +3 -0
- package/dist/boundary/boundary.js.map +1 -0
- package/dist/boundary/input/input.d.ts +4 -0
- package/dist/boundary/input/input.d.ts.map +1 -0
- package/dist/boundary/input/input.js +2 -0
- package/dist/boundary/input/input.js.map +1 -0
- package/dist/boundary/input/parsers/index.d.ts +5 -0
- package/dist/boundary/input/parsers/index.d.ts.map +1 -0
- package/dist/boundary/input/parsers/index.js +2 -0
- package/dist/boundary/input/parsers/index.js.map +1 -0
- package/dist/boundary/input/plugins/index.d.ts +32 -0
- package/dist/boundary/input/plugins/index.d.ts.map +1 -0
- package/dist/boundary/input/plugins/index.js +2 -0
- package/dist/boundary/input/plugins/index.js.map +1 -0
- package/dist/boundary/output/config/index.d.ts +19 -0
- package/dist/boundary/output/config/index.d.ts.map +1 -0
- package/dist/boundary/output/config/index.js +2 -0
- package/dist/boundary/output/config/index.js.map +1 -0
- package/dist/boundary/output/output.d.ts +3 -0
- package/dist/boundary/output/output.d.ts.map +1 -0
- package/dist/boundary/output/output.js +2 -0
- package/dist/boundary/output/output.js.map +1 -0
- package/dist/boundary/scopes/scopes.d.ts +4 -0
- package/dist/boundary/scopes/scopes.d.ts.map +1 -0
- package/dist/boundary/scopes/scopes.js +11 -0
- package/dist/boundary/scopes/scopes.js.map +1 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/factory/Factory.d.ts +6 -0
- package/dist/factory/Factory.d.ts.map +1 -0
- package/dist/factory/Factory.js +5 -0
- package/dist/factory/Factory.js.map +1 -0
- package/dist/factory/files/Files.d.ts +8 -0
- package/dist/factory/files/Files.d.ts.map +1 -0
- package/dist/factory/files/Files.js +15 -0
- package/dist/factory/files/Files.js.map +1 -0
- package/dist/factory/files/index.d.ts +9 -0
- package/dist/factory/files/index.d.ts.map +1 -0
- package/dist/factory/files/index.js +11 -0
- package/dist/factory/files/index.js.map +1 -0
- package/dist/factory/index.d.ts +2 -1
- package/dist/factory/index.d.ts.map +1 -1
- package/dist/factory/index.js +2 -1
- package/dist/factory/index.js.map +1 -1
- package/dist/factory/options/Options.d.ts +20 -0
- package/dist/factory/options/Options.d.ts.map +1 -0
- package/dist/factory/options/Options.js +17 -0
- package/dist/factory/options/Options.js.map +1 -0
- package/dist/factory/options/option/Option.d.ts +6 -0
- package/dist/factory/options/option/Option.d.ts.map +1 -0
- package/dist/factory/options/option/Option.js +7 -0
- package/dist/factory/options/option/Option.js.map +1 -0
- package/dist/factory/options/option/html/index.d.ts +2 -2
- package/dist/factory/options/option/html/index.d.ts.map +1 -1
- package/dist/factory/options/option/html/index.js +2 -2
- package/dist/factory/options/option/html/index.js.map +1 -1
- package/dist/factory/options/option/js/index.d.ts +2 -2
- package/dist/factory/options/option/js/index.d.ts.map +1 -1
- package/dist/factory/options/option/js/index.js +2 -2
- package/dist/factory/options/option/js/index.js.map +1 -1
- package/dist/factory/options/option/json/index.d.ts +2 -2
- package/dist/factory/options/option/json/index.d.ts.map +1 -1
- package/dist/factory/options/option/json/index.js +2 -2
- package/dist/factory/options/option/json/index.js.map +1 -1
- package/dist/factory/options/option/jsonc/index.d.ts +2 -2
- package/dist/factory/options/option/jsonc/index.d.ts.map +1 -1
- package/dist/factory/options/option/jsonc/index.js +2 -2
- package/dist/factory/options/option/jsonc/index.js.map +1 -1
- package/dist/factory/options/option/svelte/index.d.ts +2 -2
- package/dist/factory/options/option/svelte/index.d.ts.map +1 -1
- package/dist/factory/options/option/svelte/index.js +2 -2
- package/dist/factory/options/option/svelte/index.js.map +1 -1
- package/dist/factory/options/option/ts/index.d.ts +2 -2
- package/dist/factory/options/option/ts/index.d.ts.map +1 -1
- package/dist/factory/options/option/ts/index.js +2 -2
- package/dist/factory/options/option/ts/index.js.map +1 -1
- package/dist/factory/options/option/yml/index.d.ts +2 -2
- package/dist/factory/options/option/yml/index.d.ts.map +1 -1
- package/dist/factory/options/option/yml/index.js +2 -2
- package/dist/factory/options/option/yml/index.js.map +1 -1
- package/dist/factory/ruleset/Ruleset.d.ts +12 -0
- package/dist/factory/ruleset/Ruleset.d.ts.map +1 -0
- package/dist/factory/ruleset/Ruleset.js +27 -0
- package/dist/factory/ruleset/Ruleset.js.map +1 -0
- package/dist/factory/ruleset/rule/Rule.d.ts +6 -0
- package/dist/factory/ruleset/rule/Rule.d.ts.map +1 -0
- package/dist/factory/ruleset/rule/Rule.js +9 -0
- package/dist/factory/ruleset/rule/Rule.js.map +1 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -20
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
- package/src/boundary/boundary.ts +11 -0
- package/src/{module/boundary/index.ts → boundary/input/input.ts} +1 -1
- package/src/{module/boundary → boundary/input}/parsers/index.ts +1 -1
- package/src/{module/boundary → boundary/input}/plugins/index.ts +1 -1
- package/src/{config → boundary/output/config}/index.ts +1 -1
- package/src/boundary/output/config/interface/files/IFiles.d.ts +1 -0
- package/src/boundary/output/output.ts +3 -0
- package/src/factory/Factory.ts +12 -0
- package/src/factory/files/Files.ts +15 -0
- package/src/factory/options/{index.ts → Options.ts} +1 -1
- package/src/factory/options/option/{index.ts → Option.ts} +1 -1
- package/src/factory/options/option/html/index.ts +2 -2
- package/src/factory/options/option/js/index.ts +2 -2
- package/src/factory/options/option/json/index.ts +2 -2
- package/src/factory/options/option/jsonc/index.ts +2 -2
- package/src/factory/options/option/svelte/index.ts +2 -2
- package/src/factory/options/option/ts/index.ts +2 -2
- package/src/factory/options/option/yml/index.ts +2 -2
- package/src/factory/ruleset/{index.ts → Ruleset.ts} +1 -1
- package/src/index.ts +34 -35
- package/src/config/files/IFiles.d.ts +0 -1
- package/src/factory/index.ts +0 -10
- package/src/module/index.ts +0 -9
- /package/src/{config → boundary/output/config/interface}/option/IOption.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/option/language/IOLanguage.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/option/language/ecma/IOLanguageEcma.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/option/language/globals/IOLanguageGlobals.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/option/language/parser/IOLanguageParser.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/option/language/parserOptions/IOLanguageParserOptions.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/option/language/source/IOLanguageSource.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/option/linter/IOLinter.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/option/name/IOName.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/option/plugins/IOPlugins.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/option/processor/IOProcessor.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/rules/IRules.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/rules/rule/IRule.d.ts +0 -0
- /package/src/{config → boundary/output/config/interface}/rules/rule/state/RuleSeverity.d.ts +0 -0
- /package/src/{module/scopes/index.ts → boundary/scopes/scopes.ts} +0 -0
- /package/src/factory/ruleset/rule/{index.ts → Rule.ts} +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
import Option from "../
|
1
|
+
import Option from "../Option.js";
|
2
2
|
export default class YmlOption extends Option<"yml", "yml", true, never, never, never, never, never> {
|
3
|
-
constructor(plugins: YmlOption["body"]["plugins"], parser: YmlOption["body"]["languageOptions"]["parser"],
|
3
|
+
constructor(plugins: YmlOption["body"]["plugins"], parser: YmlOption["body"]["languageOptions"]["parser"], files: readonly string[]);
|
4
4
|
}
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/yml/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,
|
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,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACrC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACtD,KAAK,EAAE,SAAS,MAAM,EAAE;CAe3B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/yml/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,
|
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,MAStC;IACC,YACE,OAAqC,EACrC,MAAsD,EACtD,KAAwB;QAExB,KAAK,CACH;YACE,IAAI,EAAE,kBAAkB;YACxB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE,EAAE,MAAM,EAAE;SAC5B,CACF,CAAC;IACJ,CAAC;CACF"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import Rule from "./rule/Rule.js";
|
2
|
+
export { Rule };
|
3
|
+
export default class Ruleset<Language extends string> {
|
4
|
+
readonly language: literalful<Language>;
|
5
|
+
readonly ruleset: readonly Rule[];
|
6
|
+
readonly overrides: Rule[];
|
7
|
+
constructor(language: literalful<Language>, ...ruleset: readonly Rule[]);
|
8
|
+
get id(): `ruleset:${literalful<Language>}`;
|
9
|
+
get flat(): IRule[];
|
10
|
+
override(...overrides: (undefined | IRule)[]): this;
|
11
|
+
}
|
12
|
+
//# sourceMappingURL=Ruleset.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Ruleset.d.ts","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,QAAQ,SAAS,MAAM;aAKhC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IAJhD,SAAgB,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;IACzC,SAAgB,SAAS,EAAE,IAAI,EAAE,CAAM;gBAGrB,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,EAC9C,GAAG,OAAO,EAAE,SAAS,IAAI,EAAE;IAK7B,IAAW,EAAE,sCAEZ;IAED,IAAW,IAAI,YAKd;IAEM,QAAQ,CAAC,GAAG,SAAS,EAAE,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE;CAcpD"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import Rule from "./rule/Rule.js";
|
2
|
+
export { Rule };
|
3
|
+
export default class Ruleset {
|
4
|
+
language;
|
5
|
+
ruleset;
|
6
|
+
overrides = [];
|
7
|
+
constructor(language, ...ruleset) {
|
8
|
+
this.language = language;
|
9
|
+
this.ruleset = [...ruleset];
|
10
|
+
}
|
11
|
+
get id() {
|
12
|
+
return `ruleset:${this.language}`;
|
13
|
+
}
|
14
|
+
get flat() {
|
15
|
+
return [
|
16
|
+
...this.ruleset.map(rules => rules.rules),
|
17
|
+
...this.overrides.map(rules => rules.rules),
|
18
|
+
];
|
19
|
+
}
|
20
|
+
override(...overrides) {
|
21
|
+
this.overrides.push(...overrides
|
22
|
+
.filter(override => typeof override !== "undefined")
|
23
|
+
.map(override => new Rule("override", override)));
|
24
|
+
return this;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=Ruleset.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Ruleset.js","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO;IAKR;IAJF,OAAO,CAAkB;IACzB,SAAS,GAAW,EAAE,CAAC;IAEvC,YACkB,QAA8B,EAC9C,GAAG,OAAwB;QADX,aAAQ,GAAR,QAAQ,CAAsB;QAG9C,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,IAAW,EAAE;QACX,OAAO,WAAW,IAAI,CAAC,QAAQ,EAAW,CAAC;IAC7C,CAAC;IAED,IAAW,IAAI;QACb,OAAO;YACL,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;YACzC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;SAC5C,CAAC;IACJ,CAAC;IAEM,QAAQ,CAAC,GAAG,SAAgC;QACjD,IAAI,CAAC,SAAS,CAAC,IAAI,CACjB,GAAG,SAAS;aACT,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,QAAQ,KAAK,WAAW,CAAC;aACnD,GAAG,CACF,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,CAClB,UAAU,EACV,QAAQ,CACT,CACF,CACJ,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../../../src/factory/ruleset/rule/Rule.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO;aAEM,EAAE,EAAE,MAAM;aACV,KAAK,EAAE,KAAK;gBADZ,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,KAAK;CAE/B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Rule.js","sourceRoot":"","sources":["../../../../src/factory/ruleset/rule/Rule.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO;IAEM;IACA;IAFlB,YACkB,EAAU,EACV,KAAY;QADZ,OAAE,GAAF,EAAE,CAAQ;QACV,UAAK,GAAL,KAAK,CAAO;IAC3B,CAAC;CACL"}
|
package/dist/index.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
import type Config from "./config/index.js";
|
4
|
-
export { Ruleset, Rule };
|
1
|
+
import type { Scope, Plugins, Parsers, Config } from "./boundary/boundary.js";
|
2
|
+
import { Ruleset, Rule } from "./factory/Factory.js";
|
5
3
|
export type { Scope };
|
6
|
-
export
|
4
|
+
export { Ruleset, Rule };
|
5
|
+
export default function (plugins: Plugins, parsers: Parsers, base: Record<Scope, string[]>, includes: Particord<Scope, string[]>, rulesets: {
|
7
6
|
[S in Scope]: Ruleset<S>;
|
8
7
|
}, overrides: Particord<Scope, IRule>): Config[];
|
9
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,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACP,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,MAAM,EAAE,CAyFV"}
|
package/dist/index.js
CHANGED
@@ -1,41 +1,42 @@
|
|
1
|
-
import scopes from "./
|
2
|
-
import {
|
1
|
+
import scopes from "./boundary/boundary.js";
|
2
|
+
import { Options, Files, Ruleset, Rule, } from "./factory/Factory.js";
|
3
3
|
export { Ruleset, Rule };
|
4
|
-
export default function (plugins, parsers,
|
4
|
+
export default function (plugins, parsers, base, includes, rulesets, overrides) {
|
5
5
|
try {
|
6
|
+
const files = new Files(base, includes);
|
6
7
|
for (const scope of scopes)
|
7
8
|
rulesets[scope].override(overrides[scope]);
|
8
|
-
const
|
9
|
-
js: new
|
10
|
-
.js(plugins.js,
|
9
|
+
const options = {
|
10
|
+
js: new Options
|
11
|
+
.js(plugins.js, files.files("js"))
|
11
12
|
.body,
|
12
|
-
ts: new
|
13
|
-
.ts(plugins.ts, parsers.ts,
|
13
|
+
ts: new Options
|
14
|
+
.ts(plugins.ts, parsers.ts, files.files("ts"))
|
14
15
|
.body,
|
15
|
-
svelte: new
|
16
|
-
.svelte(plugins.svelte, parsers.svelte, parsers.ts,
|
16
|
+
svelte: new Options
|
17
|
+
.svelte(plugins.svelte, parsers.svelte, parsers.ts, files.files("svelte"))
|
17
18
|
.body,
|
18
|
-
html: new
|
19
|
-
.html(plugins.html, parsers.html,
|
19
|
+
html: new Options
|
20
|
+
.html(plugins.html, parsers.html, files.files("html"))
|
20
21
|
.body,
|
21
|
-
json: new
|
22
|
-
.json(plugins.json, parsers.json,
|
22
|
+
json: new Options
|
23
|
+
.json(plugins.json, parsers.json, files.files("json"))
|
23
24
|
.body,
|
24
|
-
jsonc: new
|
25
|
-
.jsonc(plugins.jsonc, parsers.jsonc,
|
25
|
+
jsonc: new Options
|
26
|
+
.jsonc(plugins.jsonc, parsers.jsonc, files.files("jsonc"))
|
26
27
|
.body,
|
27
|
-
yml: new
|
28
|
-
.yml(plugins.yml, parsers.yml,
|
28
|
+
yml: new Options
|
29
|
+
.yml(plugins.yml, parsers.yml, files.files("yml"))
|
29
30
|
.body,
|
30
31
|
};
|
31
32
|
return scopes
|
32
|
-
.map(scope =>
|
33
|
+
.map(scope => options[scope].files.length > 0
|
33
34
|
? rulesets[scope]
|
34
35
|
.flat
|
35
36
|
.map(rules => {
|
36
37
|
return {
|
37
38
|
rules,
|
38
|
-
...
|
39
|
+
...options[scope],
|
39
40
|
};
|
40
41
|
})
|
41
42
|
: [])
|
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,
|
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,CAAC;QAEF,KAAK,MAAM,KAAK,IAAI,MAAM;YACxB,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAE7C,MAAM,OAAO,GAIT;YACF,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,OAAO,CAAC,EAAE,EACV,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAClB;iBACA,IAAI;YACP,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,OAAO,CAAC,EAAE,EACV,OAAO,CAAC,EAAE,EACV,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAClB;iBACA,IAAI;YACP,MAAM,EAAE,IAAI,OAAO;iBAChB,MAAM,CACL,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,EAAE,EACV,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CACtB;iBACA,IAAI;YACP,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,IAAI,EACZ,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CACpB;iBACA,IAAI;YACP,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,IAAI,EACZ,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CACpB;iBACA,IAAI;YACP,KAAK,EAAE,IAAI,OAAO;iBACf,KAAK,CACJ,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,KAAK,EACb,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CACrB;iBACA,IAAI;YACP,GAAG,EAAE,IAAI,OAAO;iBACb,GAAG,CACF,OAAO,CAAC,GAAG,EACX,OAAO,CAAC,GAAG,EACX,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CACnB;iBACA,IAAI;SACR,CAAC;QAEF,OAAO,MAAM;aACV,GAAG,CACF,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YACtC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;iBACd,IAAI;iBACJ,GAAG,CACF,KAAK,CAAC,EAAE;gBACN,OAAO;oBACL,KAAK;oBACL,GAAG,OAAO,CAAC,KAAK,CAAC;iBAClB,CAAC;YACJ,CAAC,CACF;YACH,CAAC,CAAC,EAAE,CACP;aACA,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
@@ -1,13 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "@eslinted/core",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.7.0-rc.3",
|
4
4
|
"description": "",
|
5
5
|
"keywords": [],
|
6
6
|
"license": "MIT",
|
7
7
|
"type": "module",
|
8
8
|
"private": false,
|
9
9
|
"config": {
|
10
|
-
"PACKAGE_JSON_VERSION": "20.
|
10
|
+
"PACKAGE_JSON_VERSION": "20.10.0"
|
11
11
|
},
|
12
12
|
"repository": {
|
13
13
|
"type": "git",
|
@@ -24,13 +24,16 @@
|
|
24
24
|
},
|
25
25
|
"main": "dist/index.js",
|
26
26
|
"types": "dist/index.d.ts",
|
27
|
+
"engines": {
|
28
|
+
"node": ">=20.15.0"
|
29
|
+
},
|
27
30
|
"peerDependencies": {},
|
28
31
|
"peerDependenciesMeta": {},
|
29
32
|
"optionalDependencies": {},
|
30
33
|
"dependencies": {},
|
31
34
|
"devDependencies": {
|
32
35
|
"eslint": "~8.57.0",
|
33
|
-
"linted": "~15.2
|
36
|
+
"linted": "~15.3.2",
|
34
37
|
"npm-run-all": "^4.1.5",
|
35
38
|
"typescript": "^5.5.3"
|
36
39
|
},
|
@@ -0,0 +1 @@
|
|
1
|
+
declare interface IFiles { files: readonly string[] }
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import Options from "./options/Options.js";
|
2
|
+
import Files from "./files/Files.js";
|
3
|
+
import Ruleset, { Rule } from "./ruleset/Ruleset.js";
|
4
|
+
import type { Scope } from "../index.js";
|
5
|
+
|
6
|
+
export {
|
7
|
+
Options,
|
8
|
+
Files,
|
9
|
+
Ruleset,
|
10
|
+
Rule,
|
11
|
+
type Scope,
|
12
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { Scope } from "../Factory.js";
|
2
|
+
|
3
|
+
export default class Files {
|
4
|
+
constructor(
|
5
|
+
private readonly base: Record<Scope, string[]>,
|
6
|
+
private readonly includes: Particord<Scope, string[]>,
|
7
|
+
) {}
|
8
|
+
|
9
|
+
public files(scope: Scope): readonly string[] {
|
10
|
+
return [
|
11
|
+
...this.base[scope],
|
12
|
+
...this.includes[scope] ?? [],
|
13
|
+
];
|
14
|
+
}
|
15
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import Option from "../
|
1
|
+
import Option from "../Option.js";
|
2
2
|
|
3
3
|
export default class HtmlOption extends Option<
|
4
4
|
"html",
|
@@ -13,7 +13,7 @@ export default class HtmlOption extends Option<
|
|
13
13
|
constructor(
|
14
14
|
plugins: HtmlOption["body"]["plugins"],
|
15
15
|
parser: HtmlOption["body"]["languageOptions"]["parser"],
|
16
|
-
|
16
|
+
files: readonly string[],
|
17
17
|
) {
|
18
18
|
super(
|
19
19
|
{
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import Option from "../
|
1
|
+
import Option from "../Option.js";
|
2
2
|
|
3
3
|
export default class JsOption extends Option<"js", "@stylistic"> {
|
4
4
|
constructor(
|
5
5
|
plugins: JsOption["body"]["plugins"],
|
6
|
-
|
6
|
+
files: readonly string[],
|
7
7
|
) {
|
8
8
|
super(
|
9
9
|
{
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import Option from "../
|
1
|
+
import Option from "../Option.js";
|
2
2
|
|
3
3
|
export default class JsonOption extends Option<
|
4
4
|
"json",
|
@@ -13,7 +13,7 @@ export default class JsonOption extends Option<
|
|
13
13
|
constructor(
|
14
14
|
plugins: JsonOption["body"]["plugins"],
|
15
15
|
parser: JsonOption["body"]["languageOptions"]["parser"],
|
16
|
-
|
16
|
+
files: readonly string[],
|
17
17
|
) {
|
18
18
|
super(
|
19
19
|
{
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import Option from "../
|
1
|
+
import Option from "../Option.js";
|
2
2
|
|
3
3
|
export default class JsoncOption extends Option<
|
4
4
|
"jsonc",
|
@@ -13,7 +13,7 @@ export default class JsoncOption extends Option<
|
|
13
13
|
constructor(
|
14
14
|
plugins: JsoncOption["body"]["plugins"],
|
15
15
|
parser: JsoncOption["body"]["languageOptions"]["parser"],
|
16
|
-
|
16
|
+
files: readonly string[],
|
17
17
|
) {
|
18
18
|
super(
|
19
19
|
{
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import Option from "../
|
1
|
+
import Option from "../Option.js";
|
2
2
|
import type TsOption from "../ts/index.js";
|
3
3
|
|
4
4
|
export default class SvelteOption extends Option<
|
@@ -15,7 +15,7 @@ export default class SvelteOption extends Option<
|
|
15
15
|
plugins: SvelteOption["body"]["plugins"],
|
16
16
|
svelteParser: SvelteOption["body"]["languageOptions"]["parser"],
|
17
17
|
tsParser: SvelteOption["body"]["languageOptions"]["parserOptions"]["parser"],
|
18
|
-
|
18
|
+
files: readonly string[],
|
19
19
|
) {
|
20
20
|
super(
|
21
21
|
{
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import Option from "../
|
1
|
+
import Option from "../Option.js";
|
2
2
|
import type JsOption from "../js/index.js";
|
3
3
|
|
4
4
|
export default class TsOption extends Option<
|
@@ -11,7 +11,7 @@ export default class TsOption extends Option<
|
|
11
11
|
constructor(
|
12
12
|
plugins: TsOption["body"]["plugins"],
|
13
13
|
parser: unknown,
|
14
|
-
|
14
|
+
files: readonly string[],
|
15
15
|
) {
|
16
16
|
super(
|
17
17
|
{
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import Option from "../
|
1
|
+
import Option from "../Option.js";
|
2
2
|
|
3
3
|
export default class YmlOption extends Option<
|
4
4
|
"yml",
|
@@ -13,7 +13,7 @@ export default class YmlOption extends Option<
|
|
13
13
|
constructor(
|
14
14
|
plugins: YmlOption["body"]["plugins"],
|
15
15
|
parser: YmlOption["body"]["languageOptions"]["parser"],
|
16
|
-
|
16
|
+
files: readonly string[],
|
17
17
|
) {
|
18
18
|
super(
|
19
19
|
{
|
package/src/index.ts
CHANGED
@@ -1,103 +1,102 @@
|
|
1
|
-
import scopes from "./
|
2
|
-
import {
|
3
|
-
options,
|
4
|
-
Ruleset,
|
5
|
-
Rule,
|
6
|
-
} from "./factory/index.js";
|
1
|
+
import scopes from "./boundary/boundary.js";
|
7
2
|
import type {
|
8
3
|
Scope,
|
9
4
|
Plugins,
|
10
5
|
Parsers,
|
11
|
-
|
12
|
-
|
6
|
+
Config,
|
7
|
+
} from "./boundary/boundary.js";
|
8
|
+
import {
|
9
|
+
Options,
|
10
|
+
Files,
|
11
|
+
Ruleset,
|
12
|
+
Rule,
|
13
|
+
} from "./factory/Factory.js";
|
13
14
|
|
14
|
-
export { Ruleset, Rule };
|
15
15
|
export type { Scope };
|
16
|
+
export { Ruleset, Rule };
|
16
17
|
export default function (
|
17
18
|
plugins: Plugins,
|
18
19
|
parsers: Parsers,
|
19
|
-
|
20
|
+
base: Record<Scope, string[]>,
|
20
21
|
includes: Particord<Scope, string[]>,
|
21
22
|
rulesets: { [S in Scope]: Ruleset<S> },
|
22
23
|
overrides: Particord<Scope, IRule>,
|
23
24
|
): Config[] {
|
24
25
|
try {
|
26
|
+
const files = new Files(
|
27
|
+
base,
|
28
|
+
includes,
|
29
|
+
);
|
30
|
+
|
25
31
|
for (const scope of scopes)
|
26
32
|
rulesets[scope].override(overrides[scope]);
|
27
33
|
|
28
|
-
const
|
34
|
+
const options: {
|
29
35
|
[S in Scope]: InstanceType<
|
30
|
-
typeof
|
36
|
+
typeof Options[S]
|
31
37
|
>["body"]
|
32
38
|
} = {
|
33
|
-
js: new
|
39
|
+
js: new Options
|
34
40
|
.js(
|
35
41
|
plugins.js,
|
36
|
-
|
37
|
-
...includes.js ?? [],
|
42
|
+
files.files("js"),
|
38
43
|
)
|
39
44
|
.body,
|
40
|
-
ts: new
|
45
|
+
ts: new Options
|
41
46
|
.ts(
|
42
47
|
plugins.ts,
|
43
48
|
parsers.ts,
|
44
|
-
|
45
|
-
...includes.ts ?? [],
|
49
|
+
files.files("ts"),
|
46
50
|
)
|
47
51
|
.body,
|
48
|
-
svelte: new
|
52
|
+
svelte: new Options
|
49
53
|
.svelte(
|
50
54
|
plugins.svelte,
|
51
55
|
parsers.svelte,
|
52
56
|
parsers.ts,
|
53
|
-
|
54
|
-
...includes.svelte ?? [],
|
57
|
+
files.files("svelte"),
|
55
58
|
)
|
56
59
|
.body,
|
57
|
-
html: new
|
60
|
+
html: new Options
|
58
61
|
.html(
|
59
62
|
plugins.html,
|
60
63
|
parsers.html,
|
61
|
-
|
62
|
-
...includes.html ?? [],
|
64
|
+
files.files("html"),
|
63
65
|
)
|
64
66
|
.body,
|
65
|
-
json: new
|
67
|
+
json: new Options
|
66
68
|
.json(
|
67
69
|
plugins.json,
|
68
70
|
parsers.json,
|
69
|
-
|
70
|
-
...includes.json ?? [],
|
71
|
+
files.files("json"),
|
71
72
|
)
|
72
73
|
.body,
|
73
|
-
jsonc: new
|
74
|
+
jsonc: new Options
|
74
75
|
.jsonc(
|
75
76
|
plugins.jsonc,
|
76
77
|
parsers.jsonc,
|
77
|
-
|
78
|
-
...includes.jsonc ?? [],
|
78
|
+
files.files("jsonc"),
|
79
79
|
)
|
80
80
|
.body,
|
81
|
-
yml: new
|
81
|
+
yml: new Options
|
82
82
|
.yml(
|
83
83
|
plugins.yml,
|
84
84
|
parsers.yml,
|
85
|
-
|
86
|
-
...includes.yml ?? [],
|
85
|
+
files.files("yml"),
|
87
86
|
)
|
88
87
|
.body,
|
89
88
|
};
|
90
89
|
|
91
90
|
return scopes
|
92
91
|
.map(
|
93
|
-
scope =>
|
92
|
+
scope => options[scope].files.length > 0
|
94
93
|
? rulesets[scope]
|
95
94
|
.flat
|
96
95
|
.map(
|
97
96
|
rules => {
|
98
97
|
return {
|
99
98
|
rules,
|
100
|
-
...
|
99
|
+
...options[scope],
|
101
100
|
};
|
102
101
|
},
|
103
102
|
)
|
@@ -1 +0,0 @@
|
|
1
|
-
declare interface IFiles { files: string[] }
|
package/src/factory/index.ts
DELETED
package/src/module/index.ts
DELETED
File without changes
|
File without changes
|
/package/src/{config → boundary/output/config/interface}/option/language/ecma/IOLanguageEcma.d.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|