@eslinted/core 11.1.0 → 12.0.0-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/factory/index.d.ts +2 -3
- package/dist/factory/index.d.ts.map +1 -1
- package/dist/factory/index.js.map +1 -1
- package/dist/factory/options/index.d.ts +1 -1
- package/dist/factory/options/index.d.ts.map +1 -1
- package/dist/factory/options/index.js.map +1 -1
- package/dist/factory/options/option/index.d.ts +3 -2
- package/dist/factory/options/option/index.d.ts.map +1 -1
- package/dist/factory/options/option/index.js +1 -0
- package/dist/factory/options/option/index.js.map +1 -1
- package/dist/factory/options/option/template/index.d.ts +0 -1
- package/dist/factory/options/option/template/index.d.ts.map +1 -1
- package/dist/factory/rulesets/index.d.ts +1 -1
- package/dist/factory/rulesets/index.d.ts.map +1 -1
- package/dist/factory/rulesets/index.js.map +1 -1
- package/dist/factory/rulesets/ruleset.d.ts +3 -6
- package/dist/factory/rulesets/ruleset.d.ts.map +1 -1
- package/dist/factory/rulesets/ruleset.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -14
- package/dist/index.js.map +1 -1
- package/dist/interface/index.d.ts +4 -0
- package/dist/interface/index.d.ts.map +1 -0
- package/dist/{input/rules → interface}/index.js.map +1 -1
- package/dist/interface/input/imports/index.d.ts +8 -0
- package/dist/interface/input/imports/index.d.ts.map +1 -0
- package/dist/interface/input/imports/index.js.map +1 -0
- package/dist/interface/input/imports/parsers/index.d.ts +4 -0
- package/dist/interface/input/imports/parsers/index.d.ts.map +1 -0
- package/dist/interface/input/imports/parsers/index.js.map +1 -0
- package/dist/interface/input/imports/parsers/parser.d.ts +3 -0
- package/dist/interface/input/imports/parsers/parser.d.ts.map +1 -0
- package/dist/interface/input/imports/parsers/parser.js +2 -0
- package/dist/interface/input/imports/parsers/parser.js.map +1 -0
- package/dist/interface/input/imports/plugins.d.ts +3 -0
- package/dist/interface/input/imports/plugins.d.ts.map +1 -0
- package/dist/interface/input/imports/plugins.js.map +1 -0
- package/dist/interface/input/index.d.ts +5 -0
- package/dist/interface/input/index.d.ts.map +1 -0
- package/dist/interface/input/index.js.map +1 -0
- package/dist/interface/input/user/files/defaults.d.ts +3 -0
- package/dist/interface/input/user/files/defaults.d.ts.map +1 -0
- package/dist/interface/input/user/files/defaults.js +2 -0
- package/dist/interface/input/user/files/defaults.js.map +1 -0
- package/dist/interface/input/user/files/includes.d.ts +3 -0
- package/dist/interface/input/user/files/includes.d.ts.map +1 -0
- package/dist/interface/input/user/files/includes.js +2 -0
- package/dist/interface/input/user/files/includes.js.map +1 -0
- package/dist/interface/input/user/files/index.d.ts +8 -0
- package/dist/interface/input/user/files/index.d.ts.map +1 -0
- package/dist/interface/input/user/files/index.js +2 -0
- package/dist/interface/input/user/files/index.js.map +1 -0
- package/dist/interface/input/user/index.d.ts +8 -0
- package/dist/interface/input/user/index.d.ts.map +1 -0
- package/dist/interface/input/user/index.js +2 -0
- package/dist/interface/input/user/index.js.map +1 -0
- package/dist/interface/input/user/rules/defaults.d.ts +3 -0
- package/dist/interface/input/user/rules/defaults.d.ts.map +1 -0
- package/dist/interface/input/user/rules/defaults.js +2 -0
- package/dist/interface/input/user/rules/defaults.js.map +1 -0
- package/dist/interface/input/user/rules/index.d.ts +8 -0
- package/dist/interface/input/user/rules/index.d.ts.map +1 -0
- package/dist/interface/input/user/rules/index.js +2 -0
- package/dist/interface/input/user/rules/index.js.map +1 -0
- package/dist/interface/input/user/rules/overrides.d.ts +4 -0
- package/dist/interface/input/user/rules/overrides.d.ts.map +1 -0
- package/dist/interface/input/user/rules/overrides.js +2 -0
- package/dist/interface/input/user/rules/overrides.js.map +1 -0
- package/dist/interface/output/global/ignores.d.ts +5 -0
- package/dist/interface/output/global/ignores.d.ts.map +1 -0
- package/dist/interface/output/global/ignores.js +2 -0
- package/dist/interface/output/global/ignores.js.map +1 -0
- package/dist/interface/output/global/index.d.ts +8 -0
- package/dist/interface/output/global/index.d.ts.map +1 -0
- package/dist/interface/output/global/index.js +2 -0
- package/dist/interface/output/global/index.js.map +1 -0
- package/dist/interface/output/global/system.d.ts +14 -0
- package/dist/interface/output/global/system.d.ts.map +1 -0
- package/dist/interface/output/global/system.js +2 -0
- package/dist/interface/output/global/system.js.map +1 -0
- package/dist/interface/output/index.d.ts +8 -0
- package/dist/interface/output/index.d.ts.map +1 -0
- package/dist/interface/output/index.js +2 -0
- package/dist/interface/output/index.js.map +1 -0
- package/dist/interface/output/scoped.d.ts +3 -0
- package/dist/interface/output/scoped.d.ts.map +1 -0
- package/dist/interface/output/scoped.js +2 -0
- package/dist/interface/output/scoped.js.map +1 -0
- package/dist/objects/config/index.d.ts +16 -0
- package/dist/objects/config/index.d.ts.map +1 -0
- package/dist/objects/config/index.js +2 -0
- package/dist/objects/config/index.js.map +1 -0
- package/dist/objects/config/property.d.ts +2 -0
- package/dist/objects/config/property.d.ts.map +1 -0
- package/dist/objects/config/property.js +2 -0
- package/dist/objects/config/property.js.map +1 -0
- package/dist/objects/index.d.ts +4 -0
- package/dist/objects/index.d.ts.map +1 -0
- package/dist/objects/index.js +2 -0
- package/dist/{input → objects}/index.js.map +1 -1
- package/dist/objects/plugins/index.d.ts +5 -0
- package/dist/objects/plugins/index.d.ts.map +1 -0
- package/dist/objects/plugins/index.js +2 -0
- package/dist/objects/plugins/index.js.map +1 -0
- package/dist/objects/plugins/plugin.d.ts +2 -0
- package/dist/objects/plugins/plugin.d.ts.map +1 -0
- package/dist/objects/plugins/plugin.js +2 -0
- package/dist/objects/plugins/plugin.js.map +1 -0
- package/dist/{input/rules/entry → objects/rule}/index.d.ts +2 -4
- package/dist/objects/rule/index.d.ts.map +1 -0
- package/dist/objects/rule/index.js +2 -0
- package/dist/objects/rule/index.js.map +1 -0
- package/dist/{input/rules/entry → objects/rule}/record/index.d.ts +1 -0
- package/dist/objects/rule/record/index.d.ts.map +1 -0
- package/dist/objects/rule/record/index.js +2 -0
- package/dist/objects/rule/record/index.js.map +1 -0
- package/dist/objects/rule/record/state.d.ts.map +1 -0
- package/dist/objects/rule/record/state.js.map +1 -0
- package/dist/{scopes.d.ts → scopes/index.d.ts} +1 -1
- package/dist/scopes/index.d.ts.map +1 -0
- package/dist/{scopes.js → scopes/index.js} +1 -1
- package/dist/scopes/index.js.map +1 -0
- package/dist/scopes/index.spec.d.ts +2 -0
- package/dist/scopes/index.spec.d.ts.map +1 -0
- package/dist/{scopes.spec.js → scopes/index.spec.js} +2 -2
- package/dist/scopes/index.spec.js.map +1 -0
- package/package.json +1 -1
- package/src/factory/index.ts +9 -4
- package/src/factory/options/index.ts +4 -1
- package/src/factory/options/option/index.ts +91 -87
- package/src/factory/options/option/template/index.ts +3 -3
- package/src/factory/rulesets/index.ts +5 -3
- package/src/factory/rulesets/ruleset.ts +7 -4
- package/src/index.ts +31 -16
- package/src/interface/index.ts +9 -0
- package/src/interface/input/imports/index.ts +12 -0
- package/src/interface/input/imports/parsers/index.ts +8 -0
- package/src/{input/imports/parsers.ts → interface/input/imports/parsers/parser.ts} +2 -2
- package/src/interface/input/imports/plugins.ts +3 -0
- package/src/interface/input/index.ts +11 -0
- package/src/interface/input/user/files/defaults.ts +6 -0
- package/src/interface/input/user/files/includes.ts +5 -0
- package/src/interface/input/user/files/index.ts +9 -0
- package/src/interface/input/user/index.ts +13 -0
- package/src/interface/input/user/rules/defaults.ts +9 -0
- package/src/interface/input/user/rules/index.ts +13 -0
- package/src/interface/input/user/rules/overrides.ts +7 -0
- package/src/interface/output/global/ignores.ts +11 -0
- package/src/interface/output/global/index.ts +12 -0
- package/src/interface/output/global/system.ts +48 -0
- package/src/interface/output/index.ts +13 -0
- package/src/interface/output/scoped.ts +3 -0
- package/src/objects/config/index.ts +16 -0
- package/src/objects/config/property.ts +12 -0
- package/src/objects/index.ts +10 -0
- package/src/objects/plugins/index.ts +6 -0
- package/src/{input/imports/plugins.ts → objects/plugins/plugin.ts} +1 -1
- package/src/objects/rule/index.ts +8 -0
- package/src/objects/rule/record/index.ts +7 -0
- package/src/{scopes.spec.ts → scopes/index.spec.ts} +1 -1
- package/typings/common/utility/primitive/cast/number.d.ts +13 -3
- package/typings/common/utility/primitive/cast/number.spec.d.ts +57 -0
- package/dist/input/files.d.ts +0 -6
- package/dist/input/files.d.ts.map +0 -1
- package/dist/input/files.js +0 -2
- package/dist/input/files.js.map +0 -1
- package/dist/input/imports/parsers.d.ts +0 -3
- package/dist/input/imports/parsers.d.ts.map +0 -1
- package/dist/input/imports/parsers.js +0 -2
- package/dist/input/imports/parsers.js.map +0 -1
- package/dist/input/imports/plugins.d.ts +0 -2
- package/dist/input/imports/plugins.d.ts.map +0 -1
- package/dist/input/imports/plugins.js.map +0 -1
- package/dist/input/index.d.ts +0 -22
- package/dist/input/index.d.ts.map +0 -1
- package/dist/input/parsers.d.ts +0 -3
- package/dist/input/parsers.d.ts.map +0 -1
- package/dist/input/parsers.js +0 -2
- package/dist/input/parsers.js.map +0 -1
- package/dist/input/plugins.d.ts +0 -5
- package/dist/input/plugins.d.ts.map +0 -1
- package/dist/input/plugins.js +0 -2
- package/dist/input/plugins.js.map +0 -1
- package/dist/input/rules/entry/index.d.ts.map +0 -1
- package/dist/input/rules/entry/index.js.map +0 -1
- package/dist/input/rules/entry/record/index.d.ts.map +0 -1
- package/dist/input/rules/entry/record/index.js.map +0 -1
- package/dist/input/rules/entry/record/state.d.ts.map +0 -1
- package/dist/input/rules/entry/record/state.js.map +0 -1
- package/dist/input/rules/index.d.ts +0 -14
- package/dist/input/rules/index.d.ts.map +0 -1
- package/dist/output.d.ts +0 -30
- package/dist/output.d.ts.map +0 -1
- package/dist/output.js +0 -2
- package/dist/output.js.map +0 -1
- package/dist/scopes.d.ts.map +0 -1
- package/dist/scopes.js.map +0 -1
- package/dist/scopes.spec.d.ts +0 -2
- package/dist/scopes.spec.d.ts.map +0 -1
- package/dist/scopes.spec.js.map +0 -1
- package/src/input/files.ts +0 -6
- package/src/input/index.ts +0 -23
- package/src/input/parsers.ts +0 -3
- package/src/input/plugins.ts +0 -3
- package/src/input/rules/entry/index.ts +0 -7
- package/src/input/rules/entry/record/index.ts +0 -3
- package/src/input/rules/index.ts +0 -14
- package/src/output.ts +0 -68
- /package/dist/{input → interface}/index.js +0 -0
- /package/dist/{input/rules/entry → interface/input/imports}/index.js +0 -0
- /package/dist/{input/rules/entry/record → interface/input/imports/parsers}/index.js +0 -0
- /package/dist/{input → interface/input}/imports/plugins.js +0 -0
- /package/dist/{input/rules → interface/input}/index.js +0 -0
- /package/dist/{input/rules/entry → objects/rule}/record/state.d.ts +0 -0
- /package/dist/{input/rules/entry → objects/rule}/record/state.js +0 -0
- /package/src/{input/rules/entry → objects/rule}/record/state.ts +0 -0
- /package/src/{scopes.ts → scopes/index.ts} +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scoped.js","sourceRoot":"","sources":["../../../src/interface/output/scoped.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import type { RuleRecord } from "../index.js";
|
2
|
+
export interface Config {
|
3
|
+
name: `linted/${string}`;
|
4
|
+
rules: RuleRecord;
|
5
|
+
files: string[];
|
6
|
+
ignores: string[];
|
7
|
+
languageOptions: {
|
8
|
+
parser?: unknown;
|
9
|
+
parserOptions?: Table;
|
10
|
+
globals?: Table<true>;
|
11
|
+
};
|
12
|
+
processor?: string;
|
13
|
+
language?: string;
|
14
|
+
}
|
15
|
+
export type { ConfigProperty } from "./property.js";
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/objects/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAErC,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,UAAU,MAAM,EAAE,CAAC;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,EAAE;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,aAAa,CAAC,EAAE,KAAK,CAAC;QACtB,OAAO,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;KACvB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/objects/config/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../src/objects/config/property.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CACzB,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,OAAO,GACP,eAAe,GACf,iBAAiB,GACjB,WAAW,GACX,UAAU,GACV,UAAU,CACb,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"property.js","sourceRoot":"","sources":["../../../src/objects/config/property.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/objects/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,YAAY,EACV,SAAS,EACT,UAAU,EACV,SAAS,GACV,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,MAAM,EACN,cAAc,GACf,MAAM,UAAU,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/objects/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/objects/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,OAAO,GAAG,MAAM,CAC1B,MAAM,EACN;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CACrB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/objects/plugins/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/objects/plugins/plugin.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,CACjB,YAAY,GACZ,oBAAoB,GACpB,QAAQ,GACR,OAAO,GACP,cAAc,GACd,OAAO,GACP,KAAK,CACR,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/objects/plugins/plugin.ts"],"names":[],"mappings":""}
|
@@ -1,10 +1,8 @@
|
|
1
1
|
import type { RuleRecord } from "./record/index.js";
|
2
|
+
export type { RuleRecord };
|
2
3
|
export type RuleEntry = readonly [
|
3
4
|
string,
|
4
5
|
RuleRecord
|
5
6
|
];
|
6
|
-
export
|
7
|
-
type Id = string;
|
8
|
-
type Record = RuleRecord;
|
9
|
-
}
|
7
|
+
export type { RuleState } from "./record/index.js";
|
10
8
|
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/objects/rule/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,YAAY,EAAE,UAAU,EAAE,CAAC;AAC3B,MAAM,MAAM,SAAS,GAAG,SAAS;IAC/B,MAAM;IACN,UAAU;CACX,CAAC;AACF,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/objects/rule/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/objects/rule/record/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,MAAM,MAAM,UAAU,GAAG,KAAK,CAC1B,SAAS,GACT,SAAS,CAAC,SAAS,EAAE,GAAG,OAAO,EAAE,CAAC,CACrC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/objects/rule/record/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/objects/rule/record/state.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,CACpB,OAAO,GACP,MAAM,GACN,KAAK,CACR,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/objects/rule/record/state.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scopes/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AAC1C,eAAO,MAAM,MAAM,0EAST,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scopes/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;CACG,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../src/scopes/index.spec.ts"],"names":[],"mappings":""}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { expect } from "chai";
|
2
|
-
import { scopes } from "./
|
2
|
+
import { scopes } from "./index.js";
|
3
3
|
describe("Scopes", function () {
|
4
4
|
describe("shape", function () {
|
5
5
|
it("is a non-empty array", function () {
|
@@ -34,4 +34,4 @@ describe("Scopes", function () {
|
|
34
34
|
});
|
35
35
|
});
|
36
36
|
});
|
37
|
-
//# sourceMappingURL=
|
37
|
+
//# sourceMappingURL=index.spec.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../src/scopes/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAE3B,QAAQ,CAAC,QAAQ,EAAE;IACjB,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,sBAAsB,EAAE;YACzB,MAAM,CAAC,MAAM,CAAC;iBACX,EAAE,CAAC,OAAO,CAAC;iBACX,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,cAAc,EAAE;YACjB,MAAM,CAAC,MAAM,CAAC;iBACX,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;YACvC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;iBAC5B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,SAAS,EAAE;YACZ,MAAM,CAAC,MAAM,CAAC;iBACX,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;YAClC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;iBACzB,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,YAAY,EAAE;YACf,MAAM,CAAC,MAAM,CAAC;iBACX,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;YACrC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;iBAC5B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,aAAa,EAAE;YAChB,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;iBAC7B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/factory/index.ts
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
export type {
|
1
|
+
export type {
|
2
|
+
Scope,
|
3
|
+
Input,
|
4
|
+
Config,
|
5
|
+
RuleEntry,
|
6
|
+
RuleRecord,
|
7
|
+
} from "..";
|
2
8
|
|
3
|
-
import type { Input } from "..";
|
4
9
|
import { Files } from "./files";
|
5
10
|
import { Rulesets } from "./rulesets";
|
6
11
|
import Options from "./options";
|
@@ -11,8 +16,8 @@ export class Factory {
|
|
11
16
|
public readonly rulesets: Rulesets;
|
12
17
|
|
13
18
|
constructor(
|
14
|
-
files:
|
15
|
-
rules:
|
19
|
+
files: ConstructorParameters<typeof Files>[0],
|
20
|
+
rules: ConstructorParameters<typeof Rulesets>[0],
|
16
21
|
) {
|
17
22
|
this.files = new Files(files);
|
18
23
|
this.rulesets = new Rulesets(rules);
|
@@ -1,87 +1,91 @@
|
|
1
|
-
import globals from "globals";
|
2
|
-
import type {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
1
|
+
import globals from "globals";
|
2
|
+
import type {
|
3
|
+
Scope,
|
4
|
+
Config,
|
5
|
+
} from "..";
|
6
|
+
import type {
|
7
|
+
OptionTemplate,
|
8
|
+
LanguageOptions,
|
9
|
+
Globals,
|
10
|
+
} from "./template";
|
11
|
+
|
12
|
+
export default abstract class Option<
|
13
|
+
S extends Scope,
|
14
|
+
ParserOptions extends
|
15
|
+
| object
|
16
|
+
| boolean = false,
|
17
|
+
ParserCount extends 0 | 1 | 2 = 0,
|
18
|
+
Global extends Globals = never,
|
19
|
+
Processor extends object = never,
|
20
|
+
Language extends object = never,
|
21
|
+
> {
|
22
|
+
public abstract readonly scope: literalful<S>;
|
23
|
+
public abstract readonly processor: Interface<Processor> extends never
|
24
|
+
? object
|
25
|
+
: Interface<Processor> extends Readonly<Record<"processor", string>>
|
26
|
+
? Interface<Processor>
|
27
|
+
: object;
|
28
|
+
public abstract readonly language: Interface<Language> extends never
|
29
|
+
? object
|
30
|
+
: Interface<Language> extends Readonly<Record<"language", string>>
|
31
|
+
? Interface<Language>
|
32
|
+
: object;
|
33
|
+
|
34
|
+
constructor(
|
35
|
+
public readonly parser: Tuple<ParserCount, unknown>,
|
36
|
+
public readonly files: string[],
|
37
|
+
public readonly ruleset: Ruleset,
|
38
|
+
) {}
|
39
|
+
|
40
|
+
public get configs(): Config[] {
|
41
|
+
const {
|
42
|
+
scope,
|
43
|
+
ruleset,
|
44
|
+
files,
|
45
|
+
option,
|
46
|
+
} = this;
|
47
|
+
|
48
|
+
if (ruleset.scope !== scope)
|
49
|
+
throw new TypeError(`Scope mismatch between option and ruleset`, { cause: { option: scope, ruleset: ruleset.scope } });
|
50
|
+
|
51
|
+
return files.length < 1
|
52
|
+
? []
|
53
|
+
: ruleset.ruleset.map(({ id, rule }) => {
|
54
|
+
return {
|
55
|
+
name: `linted/${id}`,
|
56
|
+
files,
|
57
|
+
ignores: [],
|
58
|
+
rules: rule,
|
59
|
+
...option,
|
60
|
+
};
|
61
|
+
});
|
62
|
+
}
|
63
|
+
|
64
|
+
private get option() {
|
65
|
+
try {
|
66
|
+
const {
|
67
|
+
languageOptions,
|
68
|
+
processor,
|
69
|
+
language,
|
70
|
+
} = this;
|
71
|
+
|
72
|
+
return {
|
73
|
+
languageOptions,
|
74
|
+
...processor,
|
75
|
+
...language,
|
76
|
+
} satisfies OptionTemplate<
|
77
|
+
ParserOptions,
|
78
|
+
Global,
|
79
|
+
Processor,
|
80
|
+
Language
|
81
|
+
>;
|
82
|
+
}
|
83
|
+
catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e }); }
|
84
|
+
}
|
85
|
+
|
86
|
+
protected abstract get languageOptions(): LanguageOptions<ParserOptions, Global>;
|
87
|
+
|
88
|
+
protected globals(type: Global) {
|
89
|
+
return globals[type];
|
90
|
+
}
|
91
|
+
}
|
@@ -1,5 +1,3 @@
|
|
1
|
-
export type { Scope, Input, Output } from "../..";
|
2
|
-
|
3
1
|
import type { LanguageOptions } from "./languageOptions";
|
4
2
|
import type { Globals } from "./globals";
|
5
3
|
|
@@ -8,7 +6,9 @@ export type {
|
|
8
6
|
Globals,
|
9
7
|
};
|
10
8
|
export type OptionTemplate<
|
11
|
-
ParserOptions extends
|
9
|
+
ParserOptions extends
|
10
|
+
| boolean
|
11
|
+
| object,
|
12
12
|
GlobalTypes extends Globals,
|
13
13
|
Processor extends object,
|
14
14
|
Language extends object,
|
@@ -1,12 +1,15 @@
|
|
1
|
-
import type {
|
1
|
+
import type {
|
2
|
+
RuleEntry,
|
3
|
+
RuleRecord,
|
4
|
+
} from ".";
|
2
5
|
|
3
6
|
export class Ruleset {
|
4
|
-
public readonly ruleset: { id: string; rule:
|
7
|
+
public readonly ruleset: { id: string; rule: RuleRecord }[];
|
5
8
|
|
6
9
|
constructor(
|
7
10
|
public readonly scope: string,
|
8
|
-
rules:
|
9
|
-
override?:
|
11
|
+
rules: RuleEntry[],
|
12
|
+
override?: RuleRecord,
|
10
13
|
) {
|
11
14
|
const map = ([id, rule]: typeof rules[number]) => {
|
12
15
|
return {
|
package/src/index.ts
CHANGED
@@ -1,9 +1,22 @@
|
|
1
1
|
export type { Scope } from "./scopes";
|
2
|
+
export type {
|
3
|
+
Plugins,
|
4
|
+
RuleEntry,
|
5
|
+
RuleRecord,
|
6
|
+
RuleState,
|
7
|
+
Config,
|
8
|
+
ConfigProperty,
|
9
|
+
} from "./objects";
|
2
10
|
|
3
|
-
import type {
|
4
|
-
|
11
|
+
import type {
|
12
|
+
Input,
|
13
|
+
Output,
|
14
|
+
} from "./interface";
|
5
15
|
|
6
|
-
export type {
|
16
|
+
export type {
|
17
|
+
Input,
|
18
|
+
Output,
|
19
|
+
};
|
7
20
|
|
8
21
|
import { scopes } from "./scopes";
|
9
22
|
import {
|
@@ -19,18 +32,6 @@ export default function (input: Input): Output {
|
|
19
32
|
files,
|
20
33
|
rules,
|
21
34
|
} = input,
|
22
|
-
base = {
|
23
|
-
name: "linted",
|
24
|
-
plugins,
|
25
|
-
linterOptions: {
|
26
|
-
noInlineConfig: true,
|
27
|
-
reportUnusedDisableDirectives: "error",
|
28
|
-
},
|
29
|
-
languageOptions: {
|
30
|
-
sourceType: "module",
|
31
|
-
ecmaVersion: 2023,
|
32
|
-
},
|
33
|
-
} as const,
|
34
35
|
factory = new Factory(files, rules),
|
35
36
|
options: { [S in typeof scopes[number]]: InstanceType<typeof Options[S]>["configs"] } = {
|
36
37
|
js: new Options
|
@@ -76,7 +77,21 @@ export default function (input: Input): Output {
|
|
76
77
|
};
|
77
78
|
|
78
79
|
return [
|
79
|
-
|
80
|
+
{
|
81
|
+
ignores: [],
|
82
|
+
} as const,
|
83
|
+
{
|
84
|
+
name: "linted",
|
85
|
+
plugins,
|
86
|
+
linterOptions: {
|
87
|
+
noInlineConfig: true,
|
88
|
+
reportUnusedDisableDirectives: "error",
|
89
|
+
},
|
90
|
+
languageOptions: {
|
91
|
+
sourceType: "module",
|
92
|
+
ecmaVersion: 2023,
|
93
|
+
},
|
94
|
+
} as const,
|
80
95
|
...scopes.flatMap(scope => options[scope]),
|
81
96
|
];
|
82
97
|
}
|