@eslinted/core 19.0.3 → 20.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_test/index.d.ts +18 -18
- package/dist/_test/index.js +18 -18
- package/dist/_test/index.js.map +1 -1
- package/dist/factory/index.d.ts +5 -5
- package/dist/factory/index.d.ts.map +1 -1
- package/dist/factory/index.js +58 -54
- package/dist/factory/index.js.map +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/interface/input/imports/index.d.ts +7 -0
- package/dist/interface/input/imports/index.d.ts.map +1 -0
- package/dist/interface/input/imports/index.js +2 -0
- package/dist/interface/input/imports/index.js.map +1 -0
- package/dist/interface/input/imports/optional.d.ts +5 -0
- package/dist/interface/input/imports/optional.d.ts.map +1 -0
- package/dist/interface/input/imports/optional.js +2 -0
- package/dist/interface/input/imports/optional.js.map +1 -0
- package/dist/interface/input/imports/required.d.ts +5 -0
- package/dist/interface/input/imports/required.d.ts.map +1 -0
- package/dist/interface/input/imports/required.js +2 -0
- package/dist/interface/input/imports/required.js.map +1 -0
- package/dist/interface/input/index.d.ts +3 -5
- package/dist/interface/input/index.d.ts.map +1 -1
- package/dist/scope/dependencies/index.d.ts +3 -2
- package/dist/scope/dependencies/index.d.ts.map +1 -1
- package/dist/scope/dependencies/optional.d.ts +2 -0
- package/dist/scope/dependencies/optional.d.ts.map +1 -0
- package/dist/scope/dependencies/optional.js +2 -0
- package/dist/scope/dependencies/optional.js.map +1 -0
- package/dist/scope/dependencies/parsers.d.ts +1 -1
- package/dist/scope/dependencies/parsers.d.ts.map +1 -1
- package/dist/scope/dependencies/plugins.d.ts +1 -1
- package/dist/scope/dependencies/plugins.d.ts.map +1 -1
- package/dist/scope/index.d.ts +1 -1
- package/dist/scope/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/_test/index.ts +18 -18
- package/src/factory/index.ts +94 -65
- package/src/factory/model/manifest.d.ts +3 -1
- package/src/index.ts +44 -26
- package/src/interface/input/imports/index.ts +16 -0
- package/src/interface/input/imports/optional.ts +11 -0
- package/src/interface/input/imports/required.ts +13 -0
- package/src/interface/input/index.ts +9 -12
- package/src/scope/dependencies/index.ts +3 -2
- package/src/scope/dependencies/optional.ts +1 -0
- package/src/scope/dependencies/parsers.ts +1 -2
- package/src/scope/dependencies/plugins.ts +1 -2
- package/src/scope/index.ts +3 -2
package/dist/_test/index.d.ts
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
export declare const TEST_INPUT: {
|
2
2
|
imports: {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
3
|
+
required: {
|
4
|
+
plugins: {
|
5
|
+
"@stylistic": string;
|
6
|
+
"@typescript-eslint": string;
|
7
|
+
mocha: string;
|
8
|
+
"chai-friendly": string;
|
9
|
+
"chai-expect": string;
|
10
|
+
"@html-eslint": string;
|
11
|
+
css: string;
|
12
|
+
json: string;
|
13
|
+
jsonc: string;
|
14
|
+
yml: string;
|
15
|
+
};
|
16
|
+
parsers: {
|
17
|
+
ts: string;
|
18
|
+
html: string;
|
19
|
+
yml: string;
|
20
|
+
};
|
21
21
|
};
|
22
22
|
};
|
23
23
|
configuration: {
|
package/dist/_test/index.js
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
const ERROR = "error", OFF = "off", Plugin = "MOCK_PLUGIN", Parser = (scope) => `MOCK_PARSER:${scope}`;
|
2
2
|
export const TEST_INPUT = {
|
3
3
|
imports: {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
4
|
+
required: {
|
5
|
+
plugins: {
|
6
|
+
"@stylistic": Plugin,
|
7
|
+
"@typescript-eslint": Plugin,
|
8
|
+
mocha: Plugin,
|
9
|
+
"chai-friendly": Plugin,
|
10
|
+
"chai-expect": Plugin,
|
11
|
+
"@html-eslint": Plugin,
|
12
|
+
css: Plugin,
|
13
|
+
json: Plugin,
|
14
|
+
jsonc: Plugin,
|
15
|
+
yml: Plugin,
|
16
|
+
},
|
17
|
+
parsers: {
|
18
|
+
ts: Parser("TS"),
|
19
|
+
html: Parser("HTML"),
|
20
|
+
yml: Parser("YML"),
|
21
|
+
},
|
22
22
|
},
|
23
23
|
},
|
24
24
|
configuration: {
|
package/dist/_test/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/_test/index.ts"],"names":[],"mappings":"AAAA,MACA,KAAK,GAAG,OAAO,EACf,GAAG,GAAG,KAAK,EACX,MAAM,GAAG,aAAa,EACtB,MAAM,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,eAAe,KAAK,EAAE,CAAC;AAEnD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE;QACP,OAAO,EAAE;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/_test/index.ts"],"names":[],"mappings":"AAAA,MACA,KAAK,GAAG,OAAO,EACf,GAAG,GAAG,KAAK,EACX,MAAM,GAAG,aAAa,EACtB,MAAM,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,eAAe,KAAK,EAAE,CAAC;AAEnD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE;QACP,QAAQ,EAAE;YACR,OAAO,EAAE;gBACP,YAAY,EAAE,MAAM;gBACpB,oBAAoB,EAAE,MAAM;gBAC5B,KAAK,EAAE,MAAM;gBACb,eAAe,EAAE,MAAM;gBACvB,aAAa,EAAE,MAAM;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;qBACX;iBACF;gBACD,GAAG,EAAE;oBACH;wBACE,EAAE,EAAE,QAAQ;wBACZ,KAAK,EAAE;4BACL,cAAc,EAAE,KAAK;yBACb;qBACX;iBACF;gBACD,IAAI,EAAE;oBACJ;wBACE,EAAE,EAAE,QAAQ;wBACZ,KAAK,EAAE;4BACL,sBAAsB,EAAE,KAAK;4BAC7B,eAAe,EAAE;gCACf,KAAK;gCACL,OAAO;6BACR;4BACD,sBAAsB,EAAE;gCACtB,KAAK;gCACL,OAAO;6BACR;yBACO;qBACX;iBACF;gBACD,KAAK,EAAE;oBACL;wBACE,EAAE,EAAE,kBAAkB;wBACtB,KAAK,EAAE;4BACL,eAAe,EAAE;gCACf,KAAK;gCACL,OAAO;6BACR;yBACO;qBACX;iBACF;gBACD,MAAM,EAAE;oBACN;wBACE,EAAE,EAAE,gBAAgB;wBACpB,KAAK,EAAE;4BACL,sBAAsB,EAAE;gCACtB,KAAK;gCACL,OAAO;6BACR;yBACO;qBACX;iBACF;gBACD,GAAG,EAAE;oBACH;wBACE,EAAE,EAAE,QAAQ;wBACZ,KAAK,EAAE;4BACL,oBAAoB,EAAE,KAAK;yBACnB;qBACX;iBACF;aACF;SACF;QACD,UAAU,EAAE,EAAE;KACf;CACF,CAAC"}
|
package/dist/factory/index.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { Input } from "../interface/index.js";
|
2
2
|
import type * as Model from "./model";
|
3
|
-
export declare class Factory<
|
3
|
+
export declare class Factory<RequiredPlugin extends string, RequiredParser extends string, OptionalImport extends string, Scope extends string> {
|
4
4
|
private readonly registry;
|
5
|
-
parsers: Record<
|
5
|
+
parsers: Record<RequiredParser, unknown> & Partial<Record<OptionalImport, unknown>>;
|
6
6
|
global: {
|
7
7
|
settings: {
|
8
8
|
name: "linted/*/settings/";
|
@@ -28,7 +28,7 @@ export declare class Factory<Plugin extends string, Parser extends string, Scope
|
|
28
28
|
rules: import("../interface/index.js").Config["rules"];
|
29
29
|
}[]>;
|
30
30
|
};
|
31
|
-
constructor(tree: Model.ITree<Scope>, registry: Record<Scope, Model.IManifest<
|
31
|
+
constructor(tree: Model.ITree<Scope>, registry: Record<Scope, Model.IManifest<RequiredParser | OptionalImport>>, parsers: Record<RequiredParser, unknown> & Partial<Record<OptionalImport, unknown>>, defaults: Input<RequiredPlugin, RequiredParser, OptionalImport, Scope>["configuration"]["defaults"], { "*": globalExtension, ...scopeExtensions }?: Input<RequiredPlugin, RequiredParser, OptionalImport, Scope>["configuration"]["extensions"]);
|
32
32
|
get globals(): readonly [
|
33
33
|
{
|
34
34
|
name: "linted/*/settings/";
|
@@ -56,9 +56,9 @@ export declare class Factory<Plugin extends string, Parser extends string, Scope
|
|
56
56
|
processor?: string;
|
57
57
|
languageOptions?: {
|
58
58
|
parserOptions?: {
|
59
|
-
parser?: Record<
|
59
|
+
parser?: (Record<RequiredParser, unknown> & Partial<Record<OptionalImport, unknown>>)[RequiredParser | OptionalImport];
|
60
60
|
};
|
61
|
-
parser?: Record<
|
61
|
+
parser?: (Record<RequiredParser, unknown> & Partial<Record<OptionalImport, unknown>>)[RequiredParser | OptionalImport];
|
62
62
|
globals?: {
|
63
63
|
readonly define: false;
|
64
64
|
readonly require: false;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/factory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAEtC,qBAAa,OAAO,CAClB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/factory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAEtC,qBAAa,OAAO,CAClB,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM,EAC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
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
&& [...Object.keys(extraLanguageOptions)].length === 0
|
122
|
-
&& [...Object.keys(extraParserOptions)].length === 0
|
123
|
-
? {}
|
124
|
-
: {
|
125
|
-
languageOptions: {
|
126
|
-
...extraLanguageOptions,
|
127
|
-
...global === null
|
128
|
-
? {}
|
129
|
-
: {
|
130
|
-
globals: globals[global],
|
131
|
-
},
|
132
|
-
...parser === null
|
133
|
-
? {}
|
134
|
-
: {
|
135
|
-
parser: this.parsers[parser],
|
136
|
-
},
|
137
|
-
...subparser === null
|
138
|
-
&& [...Object.keys(extraParserOptions)].length === 0
|
139
|
-
? {}
|
140
|
-
: {
|
141
|
-
parserOptions: {
|
142
|
-
...extraParserOptions,
|
143
|
-
...subparser === null
|
144
|
-
? {}
|
145
|
-
: {
|
146
|
-
parser: this
|
147
|
-
.parsers[subparser],
|
148
|
-
},
|
149
|
-
},
|
150
|
-
},
|
151
|
-
},
|
152
|
-
},
|
153
|
-
...processor === null
|
154
|
-
? {}
|
155
|
-
: { processor },
|
156
|
-
...language === null
|
157
|
-
? {}
|
158
|
-
: { language },
|
159
|
-
},
|
160
|
-
...ruleset.map(({ id, rules, }) => {
|
161
|
-
return {
|
162
|
-
name: `linted/${id}/`,
|
113
|
+
: parser !== null
|
114
|
+
&& !(parser in this.parsers)
|
115
|
+
|| subparser !== null
|
116
|
+
&& !(subparser in this.parsers)
|
117
|
+
? []
|
118
|
+
: [
|
119
|
+
{
|
120
|
+
name: `linted/${scope}/`,
|
163
121
|
files,
|
164
122
|
ignores,
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
123
|
+
...parser === null
|
124
|
+
&& global === null
|
125
|
+
&& subparser === null
|
126
|
+
&& [...Object.keys(extraLanguageOptions)].length === 0
|
127
|
+
&& [...Object.keys(extraParserOptions)].length === 0
|
128
|
+
? {}
|
129
|
+
: {
|
130
|
+
languageOptions: {
|
131
|
+
...extraLanguageOptions,
|
132
|
+
...global === null
|
133
|
+
? {}
|
134
|
+
: {
|
135
|
+
globals: globals[global],
|
136
|
+
},
|
137
|
+
...parser === null
|
138
|
+
? {}
|
139
|
+
: {
|
140
|
+
parser: this.parsers[parser],
|
141
|
+
},
|
142
|
+
...subparser === null
|
143
|
+
&& [...Object.keys(extraParserOptions)].length === 0
|
144
|
+
? {}
|
145
|
+
: {
|
146
|
+
parserOptions: {
|
147
|
+
...extraParserOptions,
|
148
|
+
...subparser === null
|
149
|
+
? {}
|
150
|
+
: {
|
151
|
+
parser: this.parsers[subparser],
|
152
|
+
},
|
153
|
+
},
|
154
|
+
},
|
155
|
+
},
|
156
|
+
},
|
157
|
+
...processor === null
|
158
|
+
? {}
|
159
|
+
: { processor },
|
160
|
+
...language === null
|
161
|
+
? {}
|
162
|
+
: { language },
|
163
|
+
},
|
164
|
+
...ruleset.map(({ id, rules, }) => {
|
165
|
+
return {
|
166
|
+
name: `linted/${id}/`,
|
167
|
+
files,
|
168
|
+
ignores,
|
169
|
+
rules,
|
170
|
+
};
|
171
|
+
}),
|
172
|
+
];
|
169
173
|
}
|
170
174
|
}
|
171
175
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/factory/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,MAAM,OAAO,OAAO;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/factory/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,MAAM,OAAO,OAAO;IAWC;IAOV;IAZF,MAAM,CAAC;IACP,MAAM,CAAC;IAEd,YACE,IAAwB,EACP,QAMhB,EACM,OAQN,EACD,QAK8B,EAC9B,EACE,GAAG,EAAE,eAAe,GAAG,EAAE,EACzB,GAAG,eAAe,KAMe,EAAE;QA9BpB,aAAQ,GAAR,QAAQ,CAMxB;QACM,YAAO,GAAP,OAA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D,CAAC,CAAC,EAAE;gCACJ,CAAC,CAAC;oCACE,eAAe,EAAE;wCACf,GAAG,oBAAoB;wCACvB,GAAG,MAAM,KAAK,IAAI;4CAChB,CAAC,CAAC,EAAE;4CACJ,CAAC,CAAC;gDACE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC;6CACzB;wCACL,GAAG,MAAM,KAAK,IAAI;4CAChB,CAAC,CAAC,EAAE;4CACJ,CAAC,CAAC;gDACE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;6CAC7B;wCACL,GAAG,SAAS,KAAK,IAAI;+CAClB,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC;4CAClD,CAAC,CAAC,EAAE;4CACJ,CAAC,CAAC;gDACE,aAAa,EAAE;oDACb,GAAG,kBAAkB;oDACrB,GAAG,SAAS,KAAK,IAAI;wDACnB,CAAC,CAAC,EAAE;wDACJ,CAAC,CAAC;4DACE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;yDAChC;iDACN;6CACF;qCACN;iCACF;4BACL,GAAG,SAAS,KAAK,IAAI;gCACnB,CAAC,CAAC,EAAE;gCACJ,CAAC,CAAC,EAAE,SAAS,EAAE;4BACjB,GAAG,QAAQ,KAAK,IAAI;gCAClB,CAAC,CAAC,EAAE;gCACJ,CAAC,CAAC,EAAE,QAAQ,EAAE;yBACjB;wBACD,GAAG,OAAO,CAAC,GAAG,CACZ,CACE,EACE,EAAE,EACF,KAAK,GACN,EACD,EAAE;4BACF,OAAO;gCACL,IAAI,EAAE,UAAU,EAAE,GAAY;gCAC9B,KAAK;gCACL,OAAO;gCACP,KAAK;6BACN,CAAC;wBACJ,CAAC,CACF;qBACF,CAAC;IACZ,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
import { scopes } from "./scope/index.js";
|
2
|
-
import type { IPlugin, IParser } from "./scope/index.js";
|
3
1
|
import type { Input } from "./interface/index.js";
|
4
|
-
type
|
5
|
-
|
6
|
-
export {};
|
2
|
+
import type { RequiredPlugin, RequiredParser, OptionalImport } from "./scope/index.js";
|
3
|
+
import { scopes } from "./scope/index.js";
|
4
|
+
export default function ({ imports: { required: { plugins, parsers, }, optional, }, configuration: { defaults, extensions, }, }: Input<RequiredPlugin, RequiredParser, OptionalImport, (typeof scopes[number])>): unknown[];
|
7
5
|
//# 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":"AAAA,OAAO,KAAK,EACV,KAAK,EAEN,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,MAAM,EAGP,MAAM,SAAS,CAAC;AAGjB,MAAM,CAAC,OAAO,WACZ,EACE,OAAO,EAAE,EACP,QAAQ,EAAE,EACR,OAAO,EACP,OAAO,GACR,EACD,QAAa,GACd,EACD,aAAa,EAAE,EACb,QAAQ,EACR,UAAU,GACX,GACF,EAAE,KAAK,CACN,cAAc,EACd,cAAc,EACd,cAAc,EACd,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CACxB,aAgDF"}
|
package/dist/index.js
CHANGED
@@ -1,12 +1,26 @@
|
|
1
|
-
import { Factory } from "./factory/index.js";
|
2
1
|
import { scopes, tree, registry, } from "./scope/index.js";
|
3
|
-
|
2
|
+
import { Factory } from "./factory/index.js";
|
3
|
+
export default function ({ imports: { required: { plugins, parsers, }, optional = {}, }, configuration: { defaults, extensions, }, }) {
|
4
4
|
try {
|
5
|
-
const factory = new Factory(tree, registry,
|
5
|
+
const factory = new Factory(tree, registry, {
|
6
|
+
...parsers,
|
7
|
+
..."svelte" in optional
|
8
|
+
? {
|
9
|
+
svelte: optional.svelte.parser,
|
10
|
+
}
|
11
|
+
: {},
|
12
|
+
}, defaults, extensions);
|
6
13
|
return [
|
7
14
|
{
|
8
15
|
name: "linted/*/plugins/",
|
9
|
-
plugins
|
16
|
+
plugins: {
|
17
|
+
...plugins,
|
18
|
+
..."svelte" in optional
|
19
|
+
? {
|
20
|
+
svelte: optional.svelte.plugin,
|
21
|
+
}
|
22
|
+
: {},
|
23
|
+
},
|
10
24
|
},
|
11
25
|
...factory.globals,
|
12
26
|
...scopes
|
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":"AASA,OAAO,EACL,MAAM,EACN,IAAI,EACJ,QAAQ,GACT,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,WACZ,EACE,OAAO,EAAE,EACP,QAAQ,EAAE,EACR,OAAO,EACP,OAAO,GACR,EACD,QAAQ,GAAG,EAAE,GACd,EACD,aAAa,EAAE,EACb,QAAQ,EACR,UAAU,GACX,GAMF;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,OAAO,CAMvB,IAAI,EACJ,QAAQ,EACR;YACE,GAAG,OAAO;YACV,GAAG,QAAQ,IAAI,QAAQ;gBACrB,CAAC,CAAC;oBACE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM;iBAC/B;gBACH,CAAC,CAAC,EAAE;SACP,EACD,QAAQ,EACR,UAAU,CACT,CAAC;QAEN,OAAO;YACL;gBACE,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE;oBACP,GAAG,OAAO;oBACV,GAAG,QAAQ,IAAI,QAAQ;wBACrB,CAAC,CAAC;4BACE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM;yBAC/B;wBACH,CAAC,CAAC,EAAE;iBACP;aACF;YACD,GAAG,OAAO,CAAC,OAAO;YAClB,GAAG,MAAM;iBACN,OAAO,CACN,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAC9B;SAC0B,CAAC;IAClC,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,eAAe,EACf,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAC;IACJ,CAAC;AACH,CAAC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { RequiredImports } from "./required.js";
|
2
|
+
import type { OptionalImports } from "./optional.js";
|
3
|
+
export interface Imports<RequiredPlugin extends string, RequiredParser extends string, OptionalImport extends string> {
|
4
|
+
required: RequiredImports<RequiredPlugin, RequiredParser>;
|
5
|
+
optional?: OptionalImports<OptionalImport>;
|
6
|
+
}
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/imports/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,OAAO,CACtB,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM;IAE7B,QAAQ,EAAE,eAAe,CACvB,cAAc,EACd,cAAc,CACf,CAAC;IACF,QAAQ,CAAC,EAAE,eAAe,CACxB,cAAc,CACf,CAAC;CACH"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interface/input/imports/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"optional.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/imports/optional.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,CACzB,cAAc,SAAS,MAAM,IAC3B,OAAO,CACT,MAAM,CACJ,cAAc,EACd;IACE,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB,CACF,CACF,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"optional.js","sourceRoot":"","sources":["../../../../src/interface/input/imports/optional.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"required.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/imports/required.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe,CAC9B,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM;IAE7B,OAAO,EAAE,MAAM,CACb,cAAc,EACd,OAAO,CACR,CAAC;IACF,OAAO,EAAE,MAAM,CACb,cAAc,EACd,OAAO,CACR,CAAC;CACH"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"required.js","sourceRoot":"","sources":["../../../../src/interface/input/imports/required.ts"],"names":[],"mappings":""}
|
@@ -1,9 +1,7 @@
|
|
1
|
+
import type { Imports } from "./imports/index.js";
|
1
2
|
import type { Configuration } from "./configuration/index.js";
|
2
|
-
export interface Input<
|
3
|
-
imports:
|
4
|
-
plugins: Record<Plugin, unknown>;
|
5
|
-
parsers: Record<Parser, unknown>;
|
6
|
-
};
|
3
|
+
export interface Input<RequiredPlugin extends string, RequiredParser extends string, OptionalImport extends string, Scope extends string> {
|
4
|
+
imports: Imports<RequiredPlugin, RequiredParser, OptionalImport>;
|
7
5
|
configuration: Configuration<Scope>;
|
8
6
|
}
|
9
7
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,KAAK,CACpB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,KAAK,CACpB,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM,EAC7B,KAAK,SAAS,MAAM;IAEpB,OAAO,EAAE,OAAO,CACd,cAAc,EACd,cAAc,EACd,cAAc,CACf,CAAC;IACF,aAAa,EAAE,aAAa,CAC1B,KAAK,CACN,CAAC;CACH"}
|
@@ -1,3 +1,4 @@
|
|
1
|
-
export type {
|
2
|
-
export type {
|
1
|
+
export type { RequiredPlugin } from "./plugins.js";
|
2
|
+
export type { RequiredParser } from "./parsers.js";
|
3
|
+
export type { OptionalImport } from "./optional.js";
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scope/dependencies/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scope/dependencies/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"optional.d.ts","sourceRoot":"","sources":["../../../src/scope/dependencies/optional.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"optional.js","sourceRoot":"","sources":["../../../src/scope/dependencies/optional.ts"],"names":[],"mappings":""}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export type
|
1
|
+
export type RequiredParser = ("ts" | "html" | "yml");
|
2
2
|
//# sourceMappingURL=parsers.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../../src/scope/dependencies/parsers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,
|
1
|
+
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../../src/scope/dependencies/parsers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CACzB,IAAI,GACJ,MAAM,GACN,KAAK,CACR,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export type
|
1
|
+
export type RequiredPlugin = ("@stylistic" | "@typescript-eslint" | "mocha" | "chai-friendly" | "chai-expect" | "@html-eslint" | "css" | "json" | "jsonc" | "yml");
|
2
2
|
//# sourceMappingURL=plugins.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/scope/dependencies/plugins.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/scope/dependencies/plugins.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CACzB,YAAY,GACZ,oBAAoB,GACpB,OAAO,GACP,eAAe,GACf,aAAa,GACb,cAAc,GACd,KAAK,GACL,MAAM,GACN,OAAO,GACP,KAAK,CACR,CAAC"}
|
package/dist/scope/index.d.ts
CHANGED
@@ -12,5 +12,5 @@ export declare const scopes: readonly [
|
|
12
12
|
];
|
13
13
|
export { tree } from "./tree/index.js";
|
14
14
|
export { registry } from "./registry/index.js";
|
15
|
-
export type {
|
15
|
+
export type { RequiredPlugin, RequiredParser, OptionalImport, } from "./dependencies/index.js";
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scope/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,2FAWT,CAAC;AACX,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scope/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,2FAWT,CAAC;AACX,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"$schema": "https://json.schemastore.org/package",
|
4
4
|
"$help": "https://docs.npmjs.com/cli/configuring-npm/package-json",
|
5
5
|
"name": "@eslinted/core",
|
6
|
-
"version": "
|
6
|
+
"version": "20.0.0-rc.0",
|
7
7
|
"repository": "github:jimmy-zhening-luo/linted-core",
|
8
8
|
"private": false,
|
9
9
|
"engineStrict": true,
|
package/src/_test/index.ts
CHANGED
@@ -6,24 +6,24 @@ Parser = (scope: string) => `MOCK_PARSER:${scope}`;
|
|
6
6
|
|
7
7
|
export const TEST_INPUT = {
|
8
8
|
imports: {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
9
|
+
required: {
|
10
|
+
plugins: {
|
11
|
+
"@stylistic": Plugin,
|
12
|
+
"@typescript-eslint": Plugin,
|
13
|
+
mocha: Plugin,
|
14
|
+
"chai-friendly": Plugin,
|
15
|
+
"chai-expect": Plugin,
|
16
|
+
"@html-eslint": Plugin,
|
17
|
+
css: Plugin,
|
18
|
+
json: Plugin,
|
19
|
+
jsonc: Plugin,
|
20
|
+
yml: Plugin,
|
21
|
+
},
|
22
|
+
parsers: {
|
23
|
+
ts: Parser("TS"),
|
24
|
+
html: Parser("HTML"),
|
25
|
+
yml: Parser("YML"),
|
26
|
+
},
|
27
27
|
},
|
28
28
|
},
|
29
29
|
configuration: {
|
package/src/factory/index.ts
CHANGED
@@ -3,8 +3,9 @@ import type { Input } from "../interface";
|
|
3
3
|
import type * as Model from "./model";
|
4
4
|
|
5
5
|
export class Factory<
|
6
|
-
|
7
|
-
|
6
|
+
RequiredPlugin extends string,
|
7
|
+
RequiredParser extends string,
|
8
|
+
OptionalImport extends string,
|
8
9
|
Scope extends string,
|
9
10
|
> {
|
10
11
|
public global;
|
@@ -12,13 +13,37 @@ export class Factory<
|
|
12
13
|
|
13
14
|
constructor(
|
14
15
|
tree: Model.ITree<Scope>,
|
15
|
-
private readonly registry: Record<
|
16
|
-
|
17
|
-
|
16
|
+
private readonly registry: Record<
|
17
|
+
Scope,
|
18
|
+
Model.IManifest<
|
19
|
+
| RequiredParser
|
20
|
+
| OptionalImport
|
21
|
+
>
|
22
|
+
>,
|
23
|
+
public parsers: Record<
|
24
|
+
RequiredParser,
|
25
|
+
unknown
|
26
|
+
> & Partial<
|
27
|
+
Record<
|
28
|
+
OptionalImport,
|
29
|
+
unknown
|
30
|
+
>
|
31
|
+
>,
|
32
|
+
defaults: Input<
|
33
|
+
RequiredPlugin,
|
34
|
+
RequiredParser,
|
35
|
+
OptionalImport,
|
36
|
+
Scope
|
37
|
+
>["configuration"]["defaults"],
|
18
38
|
{
|
19
39
|
"*": globalExtension = {},
|
20
40
|
...scopeExtensions
|
21
|
-
}: Input<
|
41
|
+
}: Input<
|
42
|
+
RequiredPlugin,
|
43
|
+
RequiredParser,
|
44
|
+
OptionalImport,
|
45
|
+
Scope
|
46
|
+
>["configuration"]["extensions"] = {},
|
22
47
|
) {
|
23
48
|
const {
|
24
49
|
noInlineConfig = defaults
|
@@ -192,68 +217,72 @@ export class Factory<
|
|
192
217
|
? []
|
193
218
|
: ruleset.length === 0
|
194
219
|
? []
|
195
|
-
:
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
220
|
+
: parser !== null
|
221
|
+
&& !(parser in this.parsers)
|
222
|
+
|| subparser !== null
|
223
|
+
&& !(subparser in this.parsers)
|
224
|
+
? []
|
225
|
+
: [
|
226
|
+
{
|
227
|
+
name: `linted/${scope as string}/` as const,
|
228
|
+
files,
|
229
|
+
ignores,
|
230
|
+
...parser === null
|
231
|
+
&& global === null
|
232
|
+
&& subparser === null
|
233
|
+
&& [...Object.keys(extraLanguageOptions)].length === 0
|
234
|
+
&& [...Object.keys(extraParserOptions)].length === 0
|
235
|
+
? {}
|
236
|
+
: {
|
237
|
+
languageOptions: {
|
238
|
+
...extraLanguageOptions,
|
239
|
+
...global === null
|
240
|
+
? {}
|
241
|
+
: {
|
242
|
+
globals: globals[global],
|
243
|
+
},
|
244
|
+
...parser === null
|
245
|
+
? {}
|
246
|
+
: {
|
247
|
+
parser: this.parsers[parser],
|
248
|
+
},
|
249
|
+
...subparser === null
|
250
|
+
&& [...Object.keys(extraParserOptions)].length === 0
|
251
|
+
? {}
|
252
|
+
: {
|
253
|
+
parserOptions: {
|
254
|
+
...extraParserOptions,
|
255
|
+
...subparser === null
|
256
|
+
? {}
|
257
|
+
: {
|
258
|
+
parser: this.parsers[subparser],
|
259
|
+
},
|
260
|
+
},
|
231
261
|
},
|
232
|
-
|
262
|
+
},
|
233
263
|
},
|
264
|
+
...processor === null
|
265
|
+
? {}
|
266
|
+
: { processor },
|
267
|
+
...language === null
|
268
|
+
? {}
|
269
|
+
: { language },
|
270
|
+
},
|
271
|
+
...ruleset.map(
|
272
|
+
(
|
273
|
+
{
|
274
|
+
id,
|
275
|
+
rules,
|
234
276
|
},
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
...ruleset.map(
|
243
|
-
(
|
244
|
-
{
|
245
|
-
id,
|
246
|
-
rules,
|
277
|
+
) => {
|
278
|
+
return {
|
279
|
+
name: `linted/${id}/` as const,
|
280
|
+
files,
|
281
|
+
ignores,
|
282
|
+
rules,
|
283
|
+
};
|
247
284
|
},
|
248
|
-
)
|
249
|
-
|
250
|
-
name: `linted/${id}/` as const,
|
251
|
-
files,
|
252
|
-
ignores,
|
253
|
-
rules,
|
254
|
-
};
|
255
|
-
},
|
256
|
-
),
|
257
|
-
];
|
285
|
+
),
|
286
|
+
];
|
258
287
|
}
|
259
288
|
}
|
package/src/index.ts
CHANGED
@@ -1,53 +1,71 @@
|
|
1
|
-
import {
|
1
|
+
import type {
|
2
|
+
Input,
|
3
|
+
Output,
|
4
|
+
} from "./interface";
|
5
|
+
import type {
|
6
|
+
RequiredPlugin,
|
7
|
+
RequiredParser,
|
8
|
+
OptionalImport,
|
9
|
+
} from "./scope";
|
2
10
|
import {
|
3
11
|
scopes,
|
4
12
|
tree,
|
5
13
|
registry,
|
6
14
|
} from "./scope";
|
7
|
-
import
|
8
|
-
IPlugin,
|
9
|
-
IParser,
|
10
|
-
} from "./scope";
|
11
|
-
import type {
|
12
|
-
Input,
|
13
|
-
Output,
|
14
|
-
} from "./interface";
|
15
|
-
|
16
|
-
type Scope = typeof scopes[number];
|
15
|
+
import { Factory } from "./factory";
|
17
16
|
|
18
17
|
export default function (
|
19
18
|
{
|
20
19
|
imports: {
|
21
|
-
|
22
|
-
|
20
|
+
required: {
|
21
|
+
plugins,
|
22
|
+
parsers,
|
23
|
+
},
|
24
|
+
optional = {},
|
23
25
|
},
|
24
26
|
configuration: {
|
25
27
|
defaults,
|
26
28
|
extensions,
|
27
29
|
},
|
28
30
|
}: Input<
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
RequiredPlugin,
|
32
|
+
RequiredParser,
|
33
|
+
OptionalImport,
|
34
|
+
(typeof scopes[number])
|
32
35
|
>,
|
33
36
|
) {
|
34
37
|
try {
|
35
38
|
const factory = new Factory<
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
+
RequiredPlugin,
|
40
|
+
RequiredParser,
|
41
|
+
OptionalImport,
|
42
|
+
(typeof scopes[number])
|
39
43
|
>(
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
tree,
|
45
|
+
registry,
|
46
|
+
{
|
47
|
+
...parsers,
|
48
|
+
..."svelte" in optional
|
49
|
+
? {
|
50
|
+
svelte: optional.svelte.parser,
|
51
|
+
}
|
52
|
+
: {},
|
53
|
+
},
|
54
|
+
defaults,
|
55
|
+
extensions,
|
56
|
+
);
|
46
57
|
|
47
58
|
return [
|
48
59
|
{
|
49
60
|
name: "linted/*/plugins/",
|
50
|
-
plugins
|
61
|
+
plugins: {
|
62
|
+
...plugins,
|
63
|
+
..."svelte" in optional
|
64
|
+
? {
|
65
|
+
svelte: optional.svelte.plugin,
|
66
|
+
}
|
67
|
+
: {},
|
68
|
+
},
|
51
69
|
},
|
52
70
|
...factory.globals,
|
53
71
|
...scopes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import type { RequiredImports } from "./required";
|
2
|
+
import type { OptionalImports } from "./optional";
|
3
|
+
|
4
|
+
export interface Imports<
|
5
|
+
RequiredPlugin extends string,
|
6
|
+
RequiredParser extends string,
|
7
|
+
OptionalImport extends string,
|
8
|
+
> {
|
9
|
+
required: RequiredImports<
|
10
|
+
RequiredPlugin,
|
11
|
+
RequiredParser
|
12
|
+
>;
|
13
|
+
optional?: OptionalImports<
|
14
|
+
OptionalImport
|
15
|
+
>;
|
16
|
+
}
|
@@ -1,20 +1,17 @@
|
|
1
|
+
import type { Imports } from "./imports";
|
1
2
|
import type { Configuration } from "./configuration";
|
2
3
|
|
3
4
|
export interface Input<
|
4
|
-
|
5
|
-
|
5
|
+
RequiredPlugin extends string,
|
6
|
+
RequiredParser extends string,
|
7
|
+
OptionalImport extends string,
|
6
8
|
Scope extends string,
|
7
9
|
> {
|
8
|
-
imports:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
parsers: Record<
|
14
|
-
Parser,
|
15
|
-
unknown
|
16
|
-
>;
|
17
|
-
};
|
10
|
+
imports: Imports<
|
11
|
+
RequiredPlugin,
|
12
|
+
RequiredParser,
|
13
|
+
OptionalImport
|
14
|
+
>;
|
18
15
|
configuration: Configuration<
|
19
16
|
Scope
|
20
17
|
>;
|
@@ -1,2 +1,3 @@
|
|
1
|
-
export type {
|
2
|
-
export type {
|
1
|
+
export type { RequiredPlugin } from "./plugins";
|
2
|
+
export type { RequiredParser } from "./parsers";
|
3
|
+
export type { OptionalImport } from "./optional";
|
@@ -0,0 +1 @@
|
|
1
|
+
export type OptionalImport = "svelte";
|
package/src/scope/index.ts
CHANGED