@eslinted/core 0.0.1-rc.1 → 0.0.1-rc.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +65 -1
- package/dist/index.js.map +1 -1
- package/dist/options/HtmlOption.d.ts +5 -0
- package/dist/options/HtmlOption.d.ts.map +1 -0
- package/dist/options/HtmlOption.js +16 -0
- package/dist/options/HtmlOption.js.map +1 -0
- package/dist/options/JsOption.d.ts +5 -0
- package/dist/options/JsOption.d.ts.map +1 -0
- package/dist/options/JsOption.js +19 -0
- package/dist/options/JsOption.js.map +1 -0
- package/dist/options/JsonOption.d.ts +5 -0
- package/dist/options/JsonOption.d.ts.map +1 -0
- package/dist/options/JsonOption.js +16 -0
- package/dist/options/JsonOption.js.map +1 -0
- package/dist/options/JsoncOption.d.ts +5 -0
- package/dist/options/JsoncOption.d.ts.map +1 -0
- package/dist/options/JsoncOption.js +16 -0
- package/dist/options/JsoncOption.js.map +1 -0
- package/dist/options/MdOption.d.ts +5 -0
- package/dist/options/MdOption.d.ts.map +1 -0
- package/dist/options/MdOption.js +16 -0
- package/dist/options/MdOption.js.map +1 -0
- package/dist/options/SvelteOption.d.ts +10 -0
- package/dist/options/SvelteOption.d.ts.map +1 -0
- package/dist/options/SvelteOption.js +28 -0
- package/dist/options/SvelteOption.js.map +1 -0
- package/dist/options/TsOption.d.ts +8 -0
- package/dist/options/TsOption.d.ts.map +1 -0
- package/dist/options/TsOption.js +25 -0
- package/dist/options/TsOption.js.map +1 -0
- package/dist/options/YmlOption.d.ts +5 -0
- package/dist/options/YmlOption.d.ts.map +1 -0
- package/dist/options/YmlOption.js +16 -0
- package/dist/options/YmlOption.js.map +1 -0
- package/dist/options/option/Option.d.ts +5 -0
- package/dist/options/option/Option.d.ts.map +1 -0
- package/dist/options/option/Option.js +7 -0
- package/dist/options/option/Option.js.map +1 -0
- package/dist/options.d.ts +18 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +17 -0
- package/dist/options.js.map +1 -0
- package/dist/plugins.d.ts +34 -0
- package/dist/plugins.d.ts.map +1 -0
- package/dist/plugins.js +2 -0
- package/dist/plugins.js.map +1 -0
- package/dist/rulesets/ruleset/Ruleset.d.ts +12 -0
- package/dist/rulesets/ruleset/Ruleset.d.ts.map +1 -0
- package/dist/rulesets/ruleset/Ruleset.js +27 -0
- package/dist/rulesets/ruleset/Ruleset.js.map +1 -0
- package/dist/rulesets/ruleset/rule/Rule.d.ts +6 -0
- package/dist/rulesets/ruleset/rule/Rule.d.ts.map +1 -0
- package/dist/rulesets/ruleset/rule/Rule.js +9 -0
- package/dist/rulesets/ruleset/rule/Rule.js.map +1 -0
- package/dist/scopes.d.ts +4 -0
- package/dist/scopes.d.ts.map +1 -0
- package/dist/scopes.js +11 -0
- package/dist/scopes.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +115 -0
- package/src/options/HtmlOption.ts +31 -0
- package/src/options/JsOption.ts +27 -0
- package/src/options/JsonOption.ts +31 -0
- package/src/options/JsoncOption.ts +31 -0
- package/src/options/MdOption.ts +31 -0
- package/src/options/SvelteOption.ts +47 -0
- package/src/options/TsOption.ts +40 -0
- package/src/options/YmlOption.ts +31 -0
- package/src/options/option/Option.ts +25 -0
- package/src/options.ts +18 -0
- package/src/plugins.ts +26 -0
- package/src/rulesets/ruleset/Ruleset.ts +50 -0
- package/src/rulesets/ruleset/rule/Rule.ts +6 -0
- package/src/scopes.ts +13 -0
package/dist/index.d.ts
CHANGED
@@ -1 +1,9 @@
|
|
1
|
+
import type { Scope } from "./scopes.js";
|
2
|
+
import type Plugins from "./plugins.js";
|
3
|
+
import type Ruleset from "./rulesets/ruleset/Ruleset.js";
|
4
|
+
export { default as Ruleset } from "./rulesets/ruleset/Ruleset.js";
|
5
|
+
export { Rule } from "./rulesets/ruleset/Ruleset.js";
|
6
|
+
export default function (plugins: Plugins, parsers: Record<Scope, unknown>, files: Record<Scope, string[]>, rulesets: {
|
7
|
+
[S in Scope]: Ruleset<S>;
|
8
|
+
}): IConfig[];
|
1
9
|
//# 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":""}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,EAC/B,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAC9B,QAAQ,EAAE;KAAG,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC;CAAE,GACrC,OAAO,EAAE,CAqGX"}
|
package/dist/index.js
CHANGED
@@ -1,2 +1,66 @@
|
|
1
|
-
|
1
|
+
import scopes from "./scopes.js";
|
2
|
+
import options from "./options.js";
|
3
|
+
export { default as Ruleset } from "./rulesets/ruleset/Ruleset.js";
|
4
|
+
export { Rule } from "./rulesets/ruleset/Ruleset.js";
|
5
|
+
export default function (plugins, parsers, files, rulesets) {
|
6
|
+
try {
|
7
|
+
const instantiatedOptions = {
|
8
|
+
js: new options
|
9
|
+
.js(plugins
|
10
|
+
.js, ...files
|
11
|
+
.js)
|
12
|
+
.body,
|
13
|
+
ts: new options
|
14
|
+
.ts(plugins
|
15
|
+
.ts, parsers
|
16
|
+
.ts, ...files
|
17
|
+
.ts)
|
18
|
+
.body,
|
19
|
+
svelte: new options
|
20
|
+
.svelte(plugins
|
21
|
+
.svelte, parsers
|
22
|
+
.svelte, parsers
|
23
|
+
.ts, ...files
|
24
|
+
.svelte)
|
25
|
+
.body,
|
26
|
+
html: new options
|
27
|
+
.html(plugins
|
28
|
+
.html, parsers
|
29
|
+
.html, ...files
|
30
|
+
.html)
|
31
|
+
.body,
|
32
|
+
json: new options
|
33
|
+
.json(plugins
|
34
|
+
.json, parsers
|
35
|
+
.json, ...files
|
36
|
+
.json)
|
37
|
+
.body,
|
38
|
+
jsonc: new options
|
39
|
+
.jsonc(plugins
|
40
|
+
.jsonc, parsers
|
41
|
+
.jsonc, ...files
|
42
|
+
.jsonc)
|
43
|
+
.body,
|
44
|
+
yml: new options
|
45
|
+
.yml(plugins
|
46
|
+
.yml, parsers
|
47
|
+
.yml, ...files
|
48
|
+
.yml)
|
49
|
+
.body,
|
50
|
+
};
|
51
|
+
return scopes
|
52
|
+
.map(scope => instantiatedOptions[scope].files.length > 0
|
53
|
+
? rulesets[scope].flat.map(rules => {
|
54
|
+
return {
|
55
|
+
rules,
|
56
|
+
...instantiatedOptions[scope],
|
57
|
+
};
|
58
|
+
})
|
59
|
+
: [])
|
60
|
+
.flat();
|
61
|
+
}
|
62
|
+
catch (e) {
|
63
|
+
throw new Error(`linted(): Caught exception.`, { cause: e });
|
64
|
+
}
|
65
|
+
}
|
2
66
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AAKnC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,MAAM,CAAC,OAAO,WACZ,OAAgB,EAChB,OAA+B,EAC/B,KAA8B,EAC9B,QAAsC;IAEtC,IAAI,CAAC;QACH,MAAM,mBAAmB,GAIrB;YACF,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,OAAO;iBACJ,EAAE,EACL,GAAG,KAAK;iBACL,EAAE,CACN;iBACA,IAAI;YACP,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,OAAO;iBACJ,EAAE,EACL,OAAO;iBACJ,EAAE,EACL,GAAG,KAAK;iBACL,EAAE,CACN;iBACA,IAAI;YACP,MAAM,EAAE,IAAI,OAAO;iBAChB,MAAM,CACL,OAAO;iBACJ,MAAM,EACT,OAAO;iBACJ,MAAM,EACT,OAAO;iBACJ,EAAE,EACL,GAAG,KAAK;iBACL,MAAM,CACV;iBACA,IAAI;YACP,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,OAAO;iBACJ,IAAI,EACP,OAAO;iBACJ,IAAI,EACP,GAAG,KAAK;iBACL,IAAI,CACR;iBACA,IAAI;YACP,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,OAAO;iBACJ,IAAI,EACP,OAAO;iBACJ,IAAI,EACP,GAAG,KAAK;iBACL,IAAI,CACR;iBACA,IAAI;YACP,KAAK,EAAE,IAAI,OAAO;iBACf,KAAK,CACJ,OAAO;iBACJ,KAAK,EACR,OAAO;iBACJ,KAAK,EACR,GAAG,KAAK;iBACL,KAAK,CACT;iBACA,IAAI;YACP,GAAG,EAAE,IAAI,OAAO;iBACb,GAAG,CACF,OAAO;iBACJ,GAAG,EACN,OAAO;iBACJ,GAAG,EACN,GAAG,KAAK;iBACL,GAAG,CACP;iBACA,IAAI;SACR,CAAC;QAEF,OAAO,MAAM;aACV,GAAG,CACF,KAAK,CAAC,EAAE,CACN,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YACzC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CACxB,KAAK,CAAC,EAAE;gBACN,OAAO;oBACL,KAAK;oBACL,GAAG,mBAAmB,CAAC,KAAK,CAAC;iBAC9B,CAAC;YACJ,CAAC,CACF;YACD,CAAC,CAAC,EAAE,CACT;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"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class HtmlOption extends Option<"html", "@html-eslint", true, never, never, never, never, never> {
|
3
|
+
constructor(plugins: HtmlOption["body"]["plugins"], parser: HtmlOption["body"]["languageOptions"]["parser"], ...files: string[]);
|
4
|
+
}
|
5
|
+
//# sourceMappingURL=HtmlOption.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"HtmlOption.d.ts","sourceRoot":"","sources":["../../src/options/HtmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,cAAc,EACd,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACtC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACvD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class HtmlOption extends Option {
|
3
|
+
constructor(plugins, parser, ...files) {
|
4
|
+
super({
|
5
|
+
name: "linted/scope:html",
|
6
|
+
files,
|
7
|
+
plugins,
|
8
|
+
linterOptions: {
|
9
|
+
noInlineConfig: true,
|
10
|
+
reportUnusedDisableDirectives: "error",
|
11
|
+
},
|
12
|
+
languageOptions: { parser },
|
13
|
+
});
|
14
|
+
}
|
15
|
+
}
|
16
|
+
//# sourceMappingURL=HtmlOption.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"HtmlOption.js","sourceRoot":"","sources":["../../src/options/HtmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MASvC;IACC,YACE,OAAsC,EACtC,MAAuD,EACvD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,mBAAmB;YACzB,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 @@
|
|
1
|
+
{"version":3,"file":"JsOption.d.ts","sourceRoot":"","sources":["../../src/options/JsOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAC1C,IAAI,EACJ,YAAY,CACb;gBAEG,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACpC,GAAG,KAAK,EAAE,MAAM,EAAE;CAkBrB"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class JsOption extends Option {
|
3
|
+
constructor(plugins, ...files) {
|
4
|
+
super({
|
5
|
+
name: "linted/scope:js",
|
6
|
+
files,
|
7
|
+
plugins,
|
8
|
+
linterOptions: {
|
9
|
+
noInlineConfig: true,
|
10
|
+
reportUnusedDisableDirectives: "error",
|
11
|
+
},
|
12
|
+
languageOptions: {
|
13
|
+
ecmaVersion: "latest",
|
14
|
+
sourceType: "module",
|
15
|
+
},
|
16
|
+
});
|
17
|
+
}
|
18
|
+
}
|
19
|
+
//# sourceMappingURL=JsOption.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"JsOption.js","sourceRoot":"","sources":["../../src/options/JsOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAGrC;IACC,YACE,OAAoC,EACpC,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,iBAAiB;YACvB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE;gBACf,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;aACrB;SACF,CACF,CAAC;IACJ,CAAC;CACF"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class JsonOption extends Option<"json", "jsonc", true, never, never, never, never, never> {
|
3
|
+
constructor(plugins: JsonOption["body"]["plugins"], parser: JsonOption["body"]["languageOptions"]["parser"], ...files: string[]);
|
4
|
+
}
|
5
|
+
//# sourceMappingURL=JsonOption.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"JsonOption.d.ts","sourceRoot":"","sources":["../../src/options/JsonOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACtC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACvD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class JsonOption extends Option {
|
3
|
+
constructor(plugins, parser, ...files) {
|
4
|
+
super({
|
5
|
+
name: "linted/scope:json",
|
6
|
+
files,
|
7
|
+
plugins,
|
8
|
+
linterOptions: {
|
9
|
+
noInlineConfig: true,
|
10
|
+
reportUnusedDisableDirectives: "error",
|
11
|
+
},
|
12
|
+
languageOptions: { parser },
|
13
|
+
});
|
14
|
+
}
|
15
|
+
}
|
16
|
+
//# sourceMappingURL=JsonOption.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"JsonOption.js","sourceRoot":"","sources":["../../src/options/JsonOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MASvC;IACC,YACE,OAAsC,EACtC,MAAuD,EACvD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,mBAAmB;YACzB,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,5 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class JsoncOption extends Option<"jsonc", "jsonc", true, never, never, never, never, never> {
|
3
|
+
constructor(plugins: JsoncOption["body"]["plugins"], parser: JsoncOption["body"]["languageOptions"]["parser"], ...files: string[]);
|
4
|
+
}
|
5
|
+
//# sourceMappingURL=JsoncOption.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"JsoncOption.d.ts","sourceRoot":"","sources":["../../src/options/JsoncOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM,CAC7C,OAAO,EACP,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACvC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACxD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class JsoncOption extends Option {
|
3
|
+
constructor(plugins, parser, ...files) {
|
4
|
+
super({
|
5
|
+
name: "linted/scope:jsonc",
|
6
|
+
files,
|
7
|
+
plugins,
|
8
|
+
linterOptions: {
|
9
|
+
noInlineConfig: true,
|
10
|
+
reportUnusedDisableDirectives: "error",
|
11
|
+
},
|
12
|
+
languageOptions: { parser },
|
13
|
+
});
|
14
|
+
}
|
15
|
+
}
|
16
|
+
//# sourceMappingURL=JsoncOption.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"JsoncOption.js","sourceRoot":"","sources":["../../src/options/JsoncOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MASxC;IACC,YACE,OAAuC,EACvC,MAAwD,EACxD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,oBAAoB;YAC1B,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,5 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class MdOption extends Option<"md", "yml", true, never, never, never, never, never> {
|
3
|
+
constructor(plugins: MdOption["body"]["plugins"], parser: MdOption["body"]["languageOptions"]["parser"], ...files: string[]);
|
4
|
+
}
|
5
|
+
//# sourceMappingURL=MdOption.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MdOption.d.ts","sourceRoot":"","sources":["../../src/options/MdOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAC1C,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACpC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACrD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class MdOption extends Option {
|
3
|
+
constructor(plugins, parser, ...files) {
|
4
|
+
super({
|
5
|
+
name: "linted/scope:md",
|
6
|
+
files,
|
7
|
+
plugins,
|
8
|
+
linterOptions: {
|
9
|
+
noInlineConfig: true,
|
10
|
+
reportUnusedDisableDirectives: "error",
|
11
|
+
},
|
12
|
+
languageOptions: { parser },
|
13
|
+
});
|
14
|
+
}
|
15
|
+
}
|
16
|
+
//# sourceMappingURL=MdOption.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MdOption.js","sourceRoot":"","sources":["../../src/options/MdOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MASrC;IACC,YACE,OAAoC,EACpC,MAAqD,EACrD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,iBAAiB;YACvB,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,10 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
import type TsOption from "./TsOption.js";
|
3
|
+
export default class SvelteOption extends Option<"svelte", "svelte" | keyof TsOption["body"]["plugins"], true, TsOption["body"]["languageOptions"]["parserOptions"] & {
|
4
|
+
parser: unknown;
|
5
|
+
} & {
|
6
|
+
extraFileExtensions: [".svelte"];
|
7
|
+
}, never, "svelte/svelte"> {
|
8
|
+
constructor(plugins: SvelteOption["body"]["plugins"], svelteParser: SvelteOption["body"]["languageOptions"]["parser"], tsParser: SvelteOption["body"]["languageOptions"]["parserOptions"]["parser"], ...files: string[]);
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=SvelteOption.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SvelteOption.d.ts","sourceRoot":"","sources":["../../src/options/SvelteOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAAM,CAC9C,QAAQ,EACN,QAAQ,GACR,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAEnC,IAAI,EACF,QAAQ,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,eAAe,CAAC,GACpD;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,mBAAmB,EAAE,CAAC,SAAS,CAAC,CAAA;CAAE,EACtC,KAAK,EACL,eAAe,CAChB;gBAEG,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACxC,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EAC/D,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,EAC5E,GAAG,KAAK,EAAE,MAAM,EAAE;CA2BrB"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class SvelteOption extends Option {
|
3
|
+
constructor(plugins, svelteParser, tsParser, ...files) {
|
4
|
+
super({
|
5
|
+
name: "linted/scope:svelte",
|
6
|
+
processor: "svelte/svelte",
|
7
|
+
files,
|
8
|
+
plugins,
|
9
|
+
linterOptions: {
|
10
|
+
noInlineConfig: true,
|
11
|
+
reportUnusedDisableDirectives: "error",
|
12
|
+
},
|
13
|
+
languageOptions: {
|
14
|
+
ecmaVersion: "latest",
|
15
|
+
sourceType: "module",
|
16
|
+
parser: svelteParser,
|
17
|
+
parserOptions: {
|
18
|
+
ecmaVersion: "latest",
|
19
|
+
sourceType: "module",
|
20
|
+
project: "tsconfig.json",
|
21
|
+
extraFileExtensions: [".svelte"],
|
22
|
+
parser: tsParser,
|
23
|
+
},
|
24
|
+
},
|
25
|
+
});
|
26
|
+
}
|
27
|
+
}
|
28
|
+
//# sourceMappingURL=SvelteOption.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SvelteOption.js","sourceRoot":"","sources":["../../src/options/SvelteOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAGxC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAWzC;IACC,YACE,OAAwC,EACxC,YAA+D,EAC/D,QAA4E,EAC5E,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,qBAAqB;YAC3B,SAAS,EAAE,eAAe;YAC1B,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE;gBACf,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;gBACpB,MAAM,EAAE,YAAY;gBACpB,aAAa,EAAE;oBACb,WAAW,EAAE,QAAQ;oBACrB,UAAU,EAAE,QAAQ;oBACpB,OAAO,EAAE,eAAe;oBACxB,mBAAmB,EAAE,CAAC,SAAS,CAAC;oBAChC,MAAM,EAAE,QAAQ;iBACjB;aACF;SACF,CACF,CAAC;IACJ,CAAC;CACF"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
import type JsOption from "./JsOption.js";
|
3
|
+
export default class TsOption extends Option<"ts", "@typescript-eslint" | keyof JsOption["body"]["plugins"], true, JsOption["body"]["languageOptions"] & {
|
4
|
+
project: "tsconfig.json";
|
5
|
+
}> {
|
6
|
+
constructor(plugins: TsOption["body"]["plugins"], parser: unknown, ...files: string[]);
|
7
|
+
}
|
8
|
+
//# sourceMappingURL=TsOption.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TsOption.d.ts","sourceRoot":"","sources":["../../src/options/TsOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAC1C,IAAI,EACF,oBAAoB,GACpB,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAEnC,IAAI,EACF,QAAQ,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,GACnC;IAAE,OAAO,EAAE,eAAe,CAAA;CAAE,CAC/B;gBAEG,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACpC,MAAM,EAAE,OAAO,EACf,GAAG,KAAK,EAAE,MAAM,EAAE;CAwBrB"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class TsOption extends Option {
|
3
|
+
constructor(plugins, parser, ...files) {
|
4
|
+
super({
|
5
|
+
name: "linted/scope:ts",
|
6
|
+
files,
|
7
|
+
plugins,
|
8
|
+
linterOptions: {
|
9
|
+
noInlineConfig: true,
|
10
|
+
reportUnusedDisableDirectives: "error",
|
11
|
+
},
|
12
|
+
languageOptions: {
|
13
|
+
ecmaVersion: "latest",
|
14
|
+
sourceType: "module",
|
15
|
+
parser,
|
16
|
+
parserOptions: {
|
17
|
+
ecmaVersion: "latest",
|
18
|
+
sourceType: "module",
|
19
|
+
project: "tsconfig.json",
|
20
|
+
},
|
21
|
+
},
|
22
|
+
});
|
23
|
+
}
|
24
|
+
}
|
25
|
+
//# sourceMappingURL=TsOption.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TsOption.js","sourceRoot":"","sources":["../../src/options/TsOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAGxC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAQrC;IACC,YACE,OAAoC,EACpC,MAAe,EACf,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,iBAAiB;YACvB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE;gBACf,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;gBACpB,MAAM;gBACN,aAAa,EAAE;oBACb,WAAW,EAAE,QAAQ;oBACrB,UAAU,EAAE,QAAQ;oBACpB,OAAO,EAAE,eAAe;iBACzB;aACF;SACF,CACF,CAAC;IACJ,CAAC;CACF"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
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"], ...files: string[]);
|
4
|
+
}
|
5
|
+
//# sourceMappingURL=YmlOption.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"YmlOption.d.ts","sourceRoot":"","sources":["../../src/options/YmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,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,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
export default class YmlOption extends Option {
|
3
|
+
constructor(plugins, parser, ...files) {
|
4
|
+
super({
|
5
|
+
name: "linted/scope:yml",
|
6
|
+
files,
|
7
|
+
plugins,
|
8
|
+
linterOptions: {
|
9
|
+
noInlineConfig: true,
|
10
|
+
reportUnusedDisableDirectives: "error",
|
11
|
+
},
|
12
|
+
languageOptions: { parser },
|
13
|
+
});
|
14
|
+
}
|
15
|
+
}
|
16
|
+
//# sourceMappingURL=YmlOption.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"YmlOption.js","sourceRoot":"","sources":["../../src/options/YmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAStC;IACC,YACE,OAAqC,EACrC,MAAsD,EACtD,GAAG,KAAe;QAElB,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,5 @@
|
|
1
|
+
export default class Option<Scope extends string, PluginId extends string, UseParser extends boolean = never, ParserOptions extends object = never, GlobalTypes extends string = never, ProcessorId extends string = never, Source extends IOLanguageSource.Source = "module", Ecma extends number | IOLanguageEcma.Ecma = "latest"> {
|
2
|
+
readonly body: IOption<`linted/scope:${literalful<Scope>}`, true, "error", PluginId, Ecma, Source, UseParser, ParserOptions, GlobalTypes, ProcessorId>;
|
3
|
+
constructor(body: IOption<`linted/scope:${literalful<Scope>}`, true, "error", PluginId, Ecma, Source, UseParser, ParserOptions, GlobalTypes, ProcessorId>);
|
4
|
+
}
|
5
|
+
//# sourceMappingURL=Option.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../src/options/option/Option.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,MAAM,CACzB,KAAK,SAAS,MAAM,EACpB,QAAQ,SAAS,MAAM,EACvB,SAAS,SAAS,OAAO,GAAG,KAAK,EACjC,aAAa,SAAS,MAAM,GAAG,KAAK,EACpC,WAAW,SAAS,MAAM,GAAG,KAAK,EAClC,WAAW,SAAS,MAAM,GAAG,KAAK,EAClC,MAAM,SAAS,gBAAgB,CAAC,MAAM,GAAG,QAAQ,EACjD,IAAI,SAAS,MAAM,GAAG,cAAc,CAAC,IAAI,GAAG,QAAQ;aAGlC,IAAI,EAAE,OAAO,CAC3B,gBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,EACnC,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,WAAW,CACZ;gBAXe,IAAI,EAAE,OAAO,CAC3B,gBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,EACnC,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,WAAW,CACZ;CAEJ"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Option.js","sourceRoot":"","sources":["../../../src/options/option/Option.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,MAAM;IAWP;IADlB,YACkB,IAWf;QAXe,SAAI,GAAJ,IAAI,CAWnB;IACA,CAAC;CACL"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import JsOption from "./options/JsOption.js";
|
2
|
+
import TsOption from "./options/TsOption.js";
|
3
|
+
import SvelteOption from "./options/SvelteOption.js";
|
4
|
+
import HtmlOption from "./options/HtmlOption.js";
|
5
|
+
import JsonOption from "./options/JsonOption.js";
|
6
|
+
import JsoncOption from "./options/JsoncOption.js";
|
7
|
+
import YmlOption from "./options/YmlOption.js";
|
8
|
+
declare const _default: {
|
9
|
+
js: typeof JsOption;
|
10
|
+
ts: typeof TsOption;
|
11
|
+
svelte: typeof SvelteOption;
|
12
|
+
html: typeof HtmlOption;
|
13
|
+
json: typeof JsonOption;
|
14
|
+
jsonc: typeof JsoncOption;
|
15
|
+
yml: typeof YmlOption;
|
16
|
+
};
|
17
|
+
export default _default;
|
18
|
+
//# sourceMappingURL=options.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,SAAS,MAAM,wBAAwB,CAAC;;;;;;;;;;AAE/C,wBAQmC"}
|
package/dist/options.js
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
import JsOption from "./options/JsOption.js";
|
2
|
+
import TsOption from "./options/TsOption.js";
|
3
|
+
import SvelteOption from "./options/SvelteOption.js";
|
4
|
+
import HtmlOption from "./options/HtmlOption.js";
|
5
|
+
import JsonOption from "./options/JsonOption.js";
|
6
|
+
import JsoncOption from "./options/JsoncOption.js";
|
7
|
+
import YmlOption from "./options/YmlOption.js";
|
8
|
+
export default {
|
9
|
+
js: JsOption,
|
10
|
+
ts: TsOption,
|
11
|
+
svelte: SvelteOption,
|
12
|
+
html: HtmlOption,
|
13
|
+
json: JsonOption,
|
14
|
+
jsonc: JsoncOption,
|
15
|
+
yml: YmlOption,
|
16
|
+
};
|
17
|
+
//# sourceMappingURL=options.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C,eAAe;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,MAAM,EAAE,YAAY;IACpB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,WAAW;IAClB,GAAG,EAAE,SAAS;CACkB,CAAC"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import type { Scope } from "./scopes.js";
|
2
|
+
type PluginPackage = {
|
3
|
+
configs: unknown;
|
4
|
+
};
|
5
|
+
export default interface Plugins extends Record<Scope, Record<string, {
|
6
|
+
configs: unknown;
|
7
|
+
}>> {
|
8
|
+
js: {
|
9
|
+
"@stylistic": PluginPackage;
|
10
|
+
};
|
11
|
+
ts: {
|
12
|
+
"@stylistic": PluginPackage;
|
13
|
+
"@typescript-eslint": PluginPackage;
|
14
|
+
};
|
15
|
+
svelte: {
|
16
|
+
"@stylistic": PluginPackage;
|
17
|
+
"@typescript-eslint": PluginPackage;
|
18
|
+
svelte: PluginPackage;
|
19
|
+
};
|
20
|
+
html: {
|
21
|
+
"@html-eslint": PluginPackage;
|
22
|
+
};
|
23
|
+
json: {
|
24
|
+
jsonc: PluginPackage;
|
25
|
+
};
|
26
|
+
jsonc: {
|
27
|
+
jsonc: PluginPackage;
|
28
|
+
};
|
29
|
+
yml: {
|
30
|
+
yml: PluginPackage;
|
31
|
+
};
|
32
|
+
}
|
33
|
+
export {};
|
34
|
+
//# sourceMappingURL=plugins.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,KAAK,aAAa,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1C,MAAM,CAAC,OAAO,WAAW,OAAQ,SAAQ,MAAM,CAC7C,KAAK,EACL,MAAM,CACJ,MAAM,EACN;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CACrB,CACF;IACC,EAAE,EAAE;QAAE,YAAY,EAAE,aAAa,CAAA;KAAE,CAAC;IACpC,EAAE,EAAE;QACF,YAAY,EAAE,aAAa,CAAC;QAC5B,oBAAoB,EAAE,aAAa,CAAC;KACrC,CAAC;IACF,MAAM,EAAE;QACN,YAAY,EAAE,aAAa,CAAC;QAC5B,oBAAoB,EAAE,aAAa,CAAC;QACpC,MAAM,EAAE,aAAa,CAAC;KACvB,CAAC;IACF,IAAI,EAAE;QAAE,cAAc,EAAE,aAAa,CAAA;KAAE,CAAC;IACxC,IAAI,EAAE;QAAE,KAAK,EAAE,aAAa,CAAA;KAAE,CAAC;IAC/B,KAAK,EAAE;QAAE,KAAK,EAAE,aAAa,CAAA;KAAE,CAAC;IAChC,GAAG,EAAE;QAAE,GAAG,EAAE,aAAa,CAAA;KAAE,CAAC;CAC7B"}
|
package/dist/plugins.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import Rule from "./rule/Rule.js";
|
2
|
+
export { default as Rule } from "./rule/Rule.js";
|
3
|
+
export default class Ruleset<Language extends string> {
|
4
|
+
protected 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/rulesets/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACjD,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,QAAQ,SAAS,MAAM;IAKhD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IAJnD,SAAgB,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;IACzC,SAAgB,SAAS,EAAE,IAAI,EAAE,CAAM;gBAGlB,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,EACjD,GAAG,OAAO,EAAE,SAAS,IAAI,EAAE;IAK7B,IAAW,EAAE,sCAEZ;IAED,IAAW,IAAI,YAWd;IAEM,QAAQ,CAAC,GAAG,SAAS,EAAE,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE;CAkBpD"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import Rule from "./rule/Rule.js";
|
2
|
+
export { default as Rule } from "./rule/Rule.js";
|
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/rulesets/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACjD,MAAM,CAAC,OAAO,OAAO,OAAO;IAKL;IAJL,OAAO,CAAkB;IACzB,SAAS,GAAW,EAAE,CAAC;IAEvC,YACqB,QAA8B,EACjD,GAAG,OAAwB;QADR,aAAQ,GAAR,QAAQ,CAAsB;QAGjD,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,CACjB,KAAK,CAAC,EAAE,CACN,KAAK,CAAC,KAAK,CACd;YACD,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CACnB,KAAK,CAAC,EAAE,CACN,KAAK,CAAC,KAAK,CACd;SACF,CAAC;IACJ,CAAC;IAEM,QAAQ,CAAC,GAAG,SAAgC;QACjD,IAAI,CAAC,SAAS,CAAC,IAAI,CACjB,GAAG,SAAS;aACT,MAAM,CACL,QAAQ,CAAC,EAAE,CACT,OAAO,QAAQ,KAAK,WAAW,CAClC;aACA,GAAG,CACF,QAAQ,CAAC,EAAE,CACT,IAAI,IAAI,CACN,UAAU,EACV,QAAQ,CACT,CACJ,CACJ,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../../../src/rulesets/ruleset/rule/Rule.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,IAAI;aAEL,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/rulesets/ruleset/rule/Rule.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,IAAI;IAEL;IACA;IAFlB,YACkB,EAAU,EACV,KAAY;QADZ,OAAE,GAAF,EAAE,CAAQ;QACV,UAAK,GAAL,KAAK,CAAO;IAC3B,CAAC;CACL"}
|
package/dist/scopes.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AAE1C,QAAA,MAAM,MAAM,iEAQF,CAAC;AAEX,eAAe,MAAM,CAAC"}
|
package/dist/scopes.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scopes.js","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG;IACb,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;CACG,CAAC;AAEX,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
@@ -0,0 +1,115 @@
|
|
1
|
+
import scopes from "./scopes.js";
|
2
|
+
import options from "./options.js";
|
3
|
+
import type { Scope } from "./scopes.js";
|
4
|
+
import type Plugins from "./plugins.js";
|
5
|
+
import type Ruleset from "./rulesets/ruleset/Ruleset.js";
|
6
|
+
|
7
|
+
export { default as Ruleset } from "./rulesets/ruleset/Ruleset.js";
|
8
|
+
export { Rule } from "./rulesets/ruleset/Ruleset.js";
|
9
|
+
export default function (
|
10
|
+
plugins: Plugins,
|
11
|
+
parsers: Record<Scope, unknown>,
|
12
|
+
files: Record<Scope, string[]>,
|
13
|
+
rulesets: { [S in Scope]: Ruleset<S> },
|
14
|
+
): IConfig[] {
|
15
|
+
try {
|
16
|
+
const instantiatedOptions: {
|
17
|
+
[S in Scope]: InstanceType<
|
18
|
+
typeof options[S]
|
19
|
+
>["body"]
|
20
|
+
} = {
|
21
|
+
js: new options
|
22
|
+
.js(
|
23
|
+
plugins
|
24
|
+
.js,
|
25
|
+
...files
|
26
|
+
.js,
|
27
|
+
)
|
28
|
+
.body,
|
29
|
+
ts: new options
|
30
|
+
.ts(
|
31
|
+
plugins
|
32
|
+
.ts,
|
33
|
+
parsers
|
34
|
+
.ts,
|
35
|
+
...files
|
36
|
+
.ts,
|
37
|
+
)
|
38
|
+
.body,
|
39
|
+
svelte: new options
|
40
|
+
.svelte(
|
41
|
+
plugins
|
42
|
+
.svelte,
|
43
|
+
parsers
|
44
|
+
.svelte,
|
45
|
+
parsers
|
46
|
+
.ts,
|
47
|
+
...files
|
48
|
+
.svelte,
|
49
|
+
)
|
50
|
+
.body,
|
51
|
+
html: new options
|
52
|
+
.html(
|
53
|
+
plugins
|
54
|
+
.html,
|
55
|
+
parsers
|
56
|
+
.html,
|
57
|
+
...files
|
58
|
+
.html,
|
59
|
+
)
|
60
|
+
.body,
|
61
|
+
json: new options
|
62
|
+
.json(
|
63
|
+
plugins
|
64
|
+
.json,
|
65
|
+
parsers
|
66
|
+
.json,
|
67
|
+
...files
|
68
|
+
.json,
|
69
|
+
)
|
70
|
+
.body,
|
71
|
+
jsonc: new options
|
72
|
+
.jsonc(
|
73
|
+
plugins
|
74
|
+
.jsonc,
|
75
|
+
parsers
|
76
|
+
.jsonc,
|
77
|
+
...files
|
78
|
+
.jsonc,
|
79
|
+
)
|
80
|
+
.body,
|
81
|
+
yml: new options
|
82
|
+
.yml(
|
83
|
+
plugins
|
84
|
+
.yml,
|
85
|
+
parsers
|
86
|
+
.yml,
|
87
|
+
...files
|
88
|
+
.yml,
|
89
|
+
)
|
90
|
+
.body,
|
91
|
+
};
|
92
|
+
|
93
|
+
return scopes
|
94
|
+
.map(
|
95
|
+
scope =>
|
96
|
+
instantiatedOptions[scope].files.length > 0
|
97
|
+
? rulesets[scope].flat.map(
|
98
|
+
rules => {
|
99
|
+
return {
|
100
|
+
rules,
|
101
|
+
...instantiatedOptions[scope],
|
102
|
+
};
|
103
|
+
},
|
104
|
+
)
|
105
|
+
: [],
|
106
|
+
)
|
107
|
+
.flat();
|
108
|
+
}
|
109
|
+
catch (e) {
|
110
|
+
throw new Error(
|
111
|
+
`linted(): Caught exception.`,
|
112
|
+
{ cause: e },
|
113
|
+
);
|
114
|
+
}
|
115
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
|
3
|
+
export default class HtmlOption extends Option<
|
4
|
+
"html",
|
5
|
+
"@html-eslint",
|
6
|
+
true,
|
7
|
+
never,
|
8
|
+
never,
|
9
|
+
never,
|
10
|
+
never,
|
11
|
+
never
|
12
|
+
> {
|
13
|
+
constructor(
|
14
|
+
plugins: HtmlOption["body"]["plugins"],
|
15
|
+
parser: HtmlOption["body"]["languageOptions"]["parser"],
|
16
|
+
...files: string[]
|
17
|
+
) {
|
18
|
+
super(
|
19
|
+
{
|
20
|
+
name: "linted/scope:html",
|
21
|
+
files,
|
22
|
+
plugins,
|
23
|
+
linterOptions: {
|
24
|
+
noInlineConfig: true,
|
25
|
+
reportUnusedDisableDirectives: "error",
|
26
|
+
},
|
27
|
+
languageOptions: { parser },
|
28
|
+
},
|
29
|
+
);
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
|
3
|
+
export default class JsOption extends Option<
|
4
|
+
"js",
|
5
|
+
"@stylistic"
|
6
|
+
> {
|
7
|
+
constructor(
|
8
|
+
plugins: JsOption["body"]["plugins"],
|
9
|
+
...files: string[]
|
10
|
+
) {
|
11
|
+
super(
|
12
|
+
{
|
13
|
+
name: "linted/scope:js",
|
14
|
+
files,
|
15
|
+
plugins,
|
16
|
+
linterOptions: {
|
17
|
+
noInlineConfig: true,
|
18
|
+
reportUnusedDisableDirectives: "error",
|
19
|
+
},
|
20
|
+
languageOptions: {
|
21
|
+
ecmaVersion: "latest",
|
22
|
+
sourceType: "module",
|
23
|
+
},
|
24
|
+
},
|
25
|
+
);
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
|
3
|
+
export default class JsonOption extends Option<
|
4
|
+
"json",
|
5
|
+
"jsonc",
|
6
|
+
true,
|
7
|
+
never,
|
8
|
+
never,
|
9
|
+
never,
|
10
|
+
never,
|
11
|
+
never
|
12
|
+
> {
|
13
|
+
constructor(
|
14
|
+
plugins: JsonOption["body"]["plugins"],
|
15
|
+
parser: JsonOption["body"]["languageOptions"]["parser"],
|
16
|
+
...files: string[]
|
17
|
+
) {
|
18
|
+
super(
|
19
|
+
{
|
20
|
+
name: "linted/scope:json",
|
21
|
+
files,
|
22
|
+
plugins,
|
23
|
+
linterOptions: {
|
24
|
+
noInlineConfig: true,
|
25
|
+
reportUnusedDisableDirectives: "error",
|
26
|
+
},
|
27
|
+
languageOptions: { parser },
|
28
|
+
},
|
29
|
+
);
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
|
3
|
+
export default class JsoncOption extends Option<
|
4
|
+
"jsonc",
|
5
|
+
"jsonc",
|
6
|
+
true,
|
7
|
+
never,
|
8
|
+
never,
|
9
|
+
never,
|
10
|
+
never,
|
11
|
+
never
|
12
|
+
> {
|
13
|
+
constructor(
|
14
|
+
plugins: JsoncOption["body"]["plugins"],
|
15
|
+
parser: JsoncOption["body"]["languageOptions"]["parser"],
|
16
|
+
...files: string[]
|
17
|
+
) {
|
18
|
+
super(
|
19
|
+
{
|
20
|
+
name: "linted/scope:jsonc",
|
21
|
+
files,
|
22
|
+
plugins,
|
23
|
+
linterOptions: {
|
24
|
+
noInlineConfig: true,
|
25
|
+
reportUnusedDisableDirectives: "error",
|
26
|
+
},
|
27
|
+
languageOptions: { parser },
|
28
|
+
},
|
29
|
+
);
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
|
3
|
+
export default class MdOption extends Option<
|
4
|
+
"md",
|
5
|
+
"yml",
|
6
|
+
true,
|
7
|
+
never,
|
8
|
+
never,
|
9
|
+
never,
|
10
|
+
never,
|
11
|
+
never
|
12
|
+
> {
|
13
|
+
constructor(
|
14
|
+
plugins: MdOption["body"]["plugins"],
|
15
|
+
parser: MdOption["body"]["languageOptions"]["parser"],
|
16
|
+
...files: string[]
|
17
|
+
) {
|
18
|
+
super(
|
19
|
+
{
|
20
|
+
name: "linted/scope:md",
|
21
|
+
files,
|
22
|
+
plugins,
|
23
|
+
linterOptions: {
|
24
|
+
noInlineConfig: true,
|
25
|
+
reportUnusedDisableDirectives: "error",
|
26
|
+
},
|
27
|
+
languageOptions: { parser },
|
28
|
+
},
|
29
|
+
);
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
import type TsOption from "./TsOption.js";
|
3
|
+
|
4
|
+
export default class SvelteOption extends Option<
|
5
|
+
"svelte",
|
6
|
+
| "svelte"
|
7
|
+
| keyof TsOption["body"]["plugins"]
|
8
|
+
,
|
9
|
+
true,
|
10
|
+
& TsOption["body"]["languageOptions"]["parserOptions"]
|
11
|
+
& { parser: unknown }
|
12
|
+
& { extraFileExtensions: [".svelte"] },
|
13
|
+
never,
|
14
|
+
"svelte/svelte"
|
15
|
+
> {
|
16
|
+
constructor(
|
17
|
+
plugins: SvelteOption["body"]["plugins"],
|
18
|
+
svelteParser: SvelteOption["body"]["languageOptions"]["parser"],
|
19
|
+
tsParser: SvelteOption["body"]["languageOptions"]["parserOptions"]["parser"],
|
20
|
+
...files: string[]
|
21
|
+
) {
|
22
|
+
super(
|
23
|
+
{
|
24
|
+
name: "linted/scope:svelte",
|
25
|
+
processor: "svelte/svelte",
|
26
|
+
files,
|
27
|
+
plugins,
|
28
|
+
linterOptions: {
|
29
|
+
noInlineConfig: true,
|
30
|
+
reportUnusedDisableDirectives: "error",
|
31
|
+
},
|
32
|
+
languageOptions: {
|
33
|
+
ecmaVersion: "latest",
|
34
|
+
sourceType: "module",
|
35
|
+
parser: svelteParser,
|
36
|
+
parserOptions: {
|
37
|
+
ecmaVersion: "latest",
|
38
|
+
sourceType: "module",
|
39
|
+
project: "tsconfig.json",
|
40
|
+
extraFileExtensions: [".svelte"],
|
41
|
+
parser: tsParser,
|
42
|
+
},
|
43
|
+
},
|
44
|
+
},
|
45
|
+
);
|
46
|
+
}
|
47
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
import type JsOption from "./JsOption.js";
|
3
|
+
|
4
|
+
export default class TsOption extends Option<
|
5
|
+
"ts",
|
6
|
+
| "@typescript-eslint"
|
7
|
+
| keyof JsOption["body"]["plugins"]
|
8
|
+
,
|
9
|
+
true,
|
10
|
+
& JsOption["body"]["languageOptions"]
|
11
|
+
& { project: "tsconfig.json" }
|
12
|
+
> {
|
13
|
+
constructor(
|
14
|
+
plugins: TsOption["body"]["plugins"],
|
15
|
+
parser: unknown,
|
16
|
+
...files: string[]
|
17
|
+
) {
|
18
|
+
super(
|
19
|
+
{
|
20
|
+
name: "linted/scope:ts",
|
21
|
+
files,
|
22
|
+
plugins,
|
23
|
+
linterOptions: {
|
24
|
+
noInlineConfig: true,
|
25
|
+
reportUnusedDisableDirectives: "error",
|
26
|
+
},
|
27
|
+
languageOptions: {
|
28
|
+
ecmaVersion: "latest",
|
29
|
+
sourceType: "module",
|
30
|
+
parser,
|
31
|
+
parserOptions: {
|
32
|
+
ecmaVersion: "latest",
|
33
|
+
sourceType: "module",
|
34
|
+
project: "tsconfig.json",
|
35
|
+
},
|
36
|
+
},
|
37
|
+
},
|
38
|
+
);
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import Option from "./option/Option.js";
|
2
|
+
|
3
|
+
export default class YmlOption extends Option<
|
4
|
+
"yml",
|
5
|
+
"yml",
|
6
|
+
true,
|
7
|
+
never,
|
8
|
+
never,
|
9
|
+
never,
|
10
|
+
never,
|
11
|
+
never
|
12
|
+
> {
|
13
|
+
constructor(
|
14
|
+
plugins: YmlOption["body"]["plugins"],
|
15
|
+
parser: YmlOption["body"]["languageOptions"]["parser"],
|
16
|
+
...files: string[]
|
17
|
+
) {
|
18
|
+
super(
|
19
|
+
{
|
20
|
+
name: "linted/scope:yml",
|
21
|
+
files,
|
22
|
+
plugins,
|
23
|
+
linterOptions: {
|
24
|
+
noInlineConfig: true,
|
25
|
+
reportUnusedDisableDirectives: "error",
|
26
|
+
},
|
27
|
+
languageOptions: { parser },
|
28
|
+
},
|
29
|
+
);
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
export default class Option<
|
2
|
+
Scope extends string,
|
3
|
+
PluginId extends string,
|
4
|
+
UseParser extends boolean = never,
|
5
|
+
ParserOptions extends object = never,
|
6
|
+
GlobalTypes extends string = never,
|
7
|
+
ProcessorId extends string = never,
|
8
|
+
Source extends IOLanguageSource.Source = "module",
|
9
|
+
Ecma extends number | IOLanguageEcma.Ecma = "latest",
|
10
|
+
> {
|
11
|
+
constructor(
|
12
|
+
public readonly body: IOption<
|
13
|
+
`linted/scope:${literalful<Scope>}`,
|
14
|
+
true,
|
15
|
+
"error",
|
16
|
+
PluginId,
|
17
|
+
Ecma,
|
18
|
+
Source,
|
19
|
+
UseParser,
|
20
|
+
ParserOptions,
|
21
|
+
GlobalTypes,
|
22
|
+
ProcessorId
|
23
|
+
>,
|
24
|
+
) {}
|
25
|
+
}
|
package/src/options.ts
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
import type { Scope } from "./scopes.js";
|
2
|
+
import JsOption from "./options/JsOption.js";
|
3
|
+
import TsOption from "./options/TsOption.js";
|
4
|
+
import SvelteOption from "./options/SvelteOption.js";
|
5
|
+
import HtmlOption from "./options/HtmlOption.js";
|
6
|
+
import JsonOption from "./options/JsonOption.js";
|
7
|
+
import JsoncOption from "./options/JsoncOption.js";
|
8
|
+
import YmlOption from "./options/YmlOption.js";
|
9
|
+
|
10
|
+
export default {
|
11
|
+
js: JsOption,
|
12
|
+
ts: TsOption,
|
13
|
+
svelte: SvelteOption,
|
14
|
+
html: HtmlOption,
|
15
|
+
json: JsonOption,
|
16
|
+
jsonc: JsoncOption,
|
17
|
+
yml: YmlOption,
|
18
|
+
} satisfies Record<Scope, unknown>;
|
package/src/plugins.ts
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
import type { Scope } from "./scopes.js";
|
2
|
+
|
3
|
+
type PluginPackage = { configs: unknown };
|
4
|
+
|
5
|
+
export default interface Plugins extends Record<
|
6
|
+
Scope,
|
7
|
+
Record<
|
8
|
+
string,
|
9
|
+
{ configs: unknown }
|
10
|
+
>
|
11
|
+
> {
|
12
|
+
js: { "@stylistic": PluginPackage };
|
13
|
+
ts: {
|
14
|
+
"@stylistic": PluginPackage;
|
15
|
+
"@typescript-eslint": PluginPackage;
|
16
|
+
};
|
17
|
+
svelte: {
|
18
|
+
"@stylistic": PluginPackage;
|
19
|
+
"@typescript-eslint": PluginPackage;
|
20
|
+
svelte: PluginPackage;
|
21
|
+
};
|
22
|
+
html: { "@html-eslint": PluginPackage };
|
23
|
+
json: { jsonc: PluginPackage };
|
24
|
+
jsonc: { jsonc: PluginPackage };
|
25
|
+
yml: { yml: PluginPackage };
|
26
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import Rule from "./rule/Rule.js";
|
2
|
+
|
3
|
+
export { default as Rule } from "./rule/Rule.js";
|
4
|
+
export default class Ruleset<Language extends string> {
|
5
|
+
public readonly ruleset: readonly Rule[];
|
6
|
+
public readonly overrides: Rule[] = [];
|
7
|
+
|
8
|
+
constructor(
|
9
|
+
protected readonly language: literalful<Language>,
|
10
|
+
...ruleset: readonly Rule[]
|
11
|
+
) {
|
12
|
+
this.ruleset = [...ruleset];
|
13
|
+
}
|
14
|
+
|
15
|
+
public get id() {
|
16
|
+
return `ruleset:${this.language}` as const;
|
17
|
+
}
|
18
|
+
|
19
|
+
public get flat() {
|
20
|
+
return [
|
21
|
+
...this.ruleset.map(
|
22
|
+
rules =>
|
23
|
+
rules.rules,
|
24
|
+
),
|
25
|
+
...this.overrides.map(
|
26
|
+
rules =>
|
27
|
+
rules.rules,
|
28
|
+
),
|
29
|
+
];
|
30
|
+
}
|
31
|
+
|
32
|
+
public override(...overrides: (undefined | IRule)[]) {
|
33
|
+
this.overrides.push(
|
34
|
+
...overrides
|
35
|
+
.filter(
|
36
|
+
override =>
|
37
|
+
typeof override !== "undefined",
|
38
|
+
)
|
39
|
+
.map(
|
40
|
+
override =>
|
41
|
+
new Rule(
|
42
|
+
"override",
|
43
|
+
override,
|
44
|
+
),
|
45
|
+
),
|
46
|
+
);
|
47
|
+
|
48
|
+
return this;
|
49
|
+
}
|
50
|
+
}
|