@eslinted/core 12.0.0 → 13.0.0-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/factory/global.d.ts +26 -0
- package/dist/factory/global.d.ts.map +1 -0
- package/dist/factory/global.js +39 -0
- package/dist/factory/global.js.map +1 -0
- package/dist/factory/index.d.ts +1 -0
- package/dist/factory/index.d.ts.map +1 -1
- package/dist/factory/index.js +1 -0
- package/dist/factory/index.js.map +1 -1
- package/dist/factory/options/html.d.ts +1 -1
- package/dist/factory/options/html.d.ts.map +1 -1
- package/dist/factory/options/html.js.map +1 -1
- package/dist/factory/options/json.d.ts +1 -1
- package/dist/factory/options/json.d.ts.map +1 -1
- package/dist/factory/options/json.js.map +1 -1
- package/dist/factory/options/jsonc.d.ts +1 -1
- package/dist/factory/options/jsonc.d.ts.map +1 -1
- package/dist/factory/options/jsonc.js.map +1 -1
- package/dist/factory/options/option/index.d.ts +40 -2978
- package/dist/factory/options/option/index.d.ts.map +1 -1
- package/dist/factory/options/option/index.js.map +1 -1
- package/dist/factory/options/option/template/index.d.ts +10 -6
- package/dist/factory/options/option/template/index.d.ts.map +1 -1
- package/dist/factory/options/option/template/languageOptions.d.ts +6 -5
- package/dist/factory/options/option/template/languageOptions.d.ts.map +1 -1
- package/dist/factory/options/svelte.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -26
- package/dist/index.js.map +1 -1
- package/dist/objects/config/global/system.d.ts +1 -1
- package/dist/objects/config/global/system.d.ts.map +1 -1
- package/dist/objects/config/scoped.d.ts +1 -5
- package/dist/objects/config/scoped.d.ts.map +1 -1
- package/dist/objects/rule/record/index.d.ts +1 -1
- package/dist/objects/rule/record/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/factory/global.ts +43 -0
- package/src/factory/index.ts +1 -0
- package/src/factory/options/html.ts +1 -2
- package/src/factory/options/json.ts +1 -2
- package/src/factory/options/jsonc.ts +1 -2
- package/src/factory/options/option/index.ts +19 -16
- package/src/factory/options/option/template/index.ts +22 -7
- package/src/factory/options/option/template/languageOptions.ts +18 -13
- package/src/factory/options/svelte.ts +1 -1
- package/src/index.ts +15 -30
- package/src/objects/config/global/system.ts +11 -12
- package/src/objects/config/scoped.ts +1 -5
- package/src/objects/rule/record/index.ts +2 -1
- package/typings/common/literals/chars/alpha.d.ts +0 -4
- package/typings/common/literals/chars/digit.d.ts +0 -12
- package/typings/common/literals/chars/digits/base64.d.ts +0 -13
- package/typings/common/literals/chars/digits/hexchar.d.ts +0 -9
- package/typings/common/literals/chars/lower.d.ts +0 -1
- package/typings/common/literals/chars/upper.d.ts +0 -28
- package/typings/common/literals/numbers/base32.d.ts +0 -19
- package/typings/common/literals/numbers/base64.d.ts +0 -35
- package/typings/common/literals/numbers/binary.d.ts +0 -4
- package/typings/common/literals/numbers/decimal.d.ts +0 -5
- package/typings/common/literals/numbers/hexadecimal.d.ts +0 -10
- package/typings/common/literals/numbers/octal.d.ts +0 -7
- package/typings/common/literals/numbers/quatral.d.ts +0 -4
- package/typings/common/literals/numbers/ternary.d.ts +0 -4
- package/typings/common/primitive.d.ts +0 -5
- package/typings/common/tester.d.ts +0 -8
- package/typings/common/utility/constructor.d.ts +0 -3
- package/typings/common/utility/interface/identity.d.ts +0 -11
- package/typings/common/utility/interface/identity.spec.d.ts +0 -63
- package/typings/common/utility/interface/index.d.ts +0 -5
- package/typings/common/utility/interface/keys.d.ts +0 -3
- package/typings/common/utility/interface/keys.spec.d.ts +0 -67
- package/typings/common/utility/interface/optional.d.ts +0 -7
- package/typings/common/utility/interface/optional.spec.d.ts +0 -34
- package/typings/common/utility/interface/partially.d.ts +0 -1
- package/typings/common/utility/interface/property/index.d.ts +0 -8
- package/typings/common/utility/interface/property/properties.d.ts +0 -6
- package/typings/common/utility/interface/table/index.d.ts +0 -3
- package/typings/common/utility/interface/table/tables.d.ts +0 -5
- package/typings/common/utility/iterable/arrayful.d.ts +0 -1
- package/typings/common/utility/iterable/flat/index.d.ts +0 -3
- package/typings/common/utility/iterable/flat/unflat.d.ts +0 -3
- package/typings/common/utility/iterable/identity.d.ts +0 -1
- package/typings/common/utility/iterable/identity.spec.d.ts +0 -59
- package/typings/common/utility/iterable/index.d.ts +0 -15
- package/typings/common/utility/iterable/index.spec.d.ts +0 -18
- package/typings/common/utility/iterable/tuple.d.ts +0 -11
- package/typings/common/utility/iterable/tuple.spec.d.ts +0 -14
- package/typings/common/utility/iterable/tuples.d.ts +0 -10
- package/typings/common/utility/null/index.d.ts +0 -1
- package/typings/common/utility/null/index.spec.d.ts +0 -13
- package/typings/common/utility/null/nullable.d.ts +0 -1
- package/typings/common/utility/null/nullable.spec.d.ts +0 -13
- package/typings/common/utility/primitive/cast/number.d.ts +0 -13
- package/typings/common/utility/primitive/cast/number.spec.d.ts +0 -57
- package/typings/common/utility/primitive/index.d.ts +0 -11
- package/typings/common/utility/primitive/index.spec.d.ts +0 -27
- package/typings/common/utility/primitive/length.d.ts +0 -5
- package/typings/common/utility/primitive/length.spec.d.ts +0 -26
- package/typings/common/utility/primitive/literal.d.ts +0 -1
- package/typings/common/utility/primitive/literal.spec.d.ts +0 -17
- package/typings/common/utility/primitive/literalful.d.ts +0 -3
- package/typings/common/utility/primitive/literalful.spec.d.ts +0 -20
- package/typings/common/utility/primitive/numeric.d.ts +0 -1
- package/typings/common/utility/primitive/numeric.spec.d.ts +0 -30
- package/typings/common/utility/primitive/truth.d.ts +0 -3
- package/typings/common/utility/primitive/truth.spec.d.ts +0 -22
- package/typings/common/validated/char.d.ts +0 -1
- package/typings/common/validated/index.d.ts +0 -2
- package/typings/common/validated/numberful.d.ts +0 -1
- package/typings/common/validated/properties/finite.d.ts +0 -2
- package/typings/common/validated/properties/int.d.ts +0 -2
- package/typings/common/validated/properties/length.d.ts +0 -3
- package/typings/common/validated/properties/polarity.d.ts +0 -5
- package/typings/common/validated/stringful.d.ts +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/option/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACb,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAEV,eAAe,EACf,OAAO,EACR,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,MAAM,CAClC,CAAC,SAAS,KAAK,EACf,aAAa,SACX,MAAM,GACN,OAAO,GAAG,KAAK,EACjB,WAAW,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/option/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACb,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAEV,eAAe,EACf,OAAO,EACR,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,MAAM,CAClC,CAAC,SAAS,KAAK,EACf,aAAa,SACX,MAAM,GACN,OAAO,GAAG,KAAK,EACjB,WAAW,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,aAAa,SAAS,KAAK,GAAG,CAAC,GAAG,CAAC,EACnE,MAAM,SAAS,OAAO,GAAG,KAAK,GAAG,KAAK,EACtC,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,QAAQ,SAAS,MAAM,GAAG,MAAM;aAkBd,MAAM,EAAE,OAAO,EAAE,GAAG;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE;aAC3C,KAAK,EAAE,MAAM,EAAE;aACf,OAAO,EAAE,MAAM,EAAE;aACjB,OAAO,EAAE,OAAO;IAnBlC,kBAAyB,KAAK,EAAE,CAAC,CAAC;IAClC,kBAAyB,SAAS,EAAE,CAAC,SAAS,SAAS,KAAK,GACxD,MAAM,GACN,SAAS,SAAS;QAAE,SAAS,EAAE,MAAM,CAAC,CAAA;KAAE,GACtC,MAAM,SAAS,CAAC,GACd,MAAM,GACN;QAAE,SAAS,EAAE,CAAC,CAAA;KAAE,GAClB,MAAM,CAAC,CAAC;IACd,kBAAyB,QAAQ,EAAE,CAAC,QAAQ,SAAS,KAAK,GACtD,MAAM,GACN,QAAQ,SAAS;QAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;KAAE,GACpC,MAAM,SAAS,CAAC,GACd,MAAM,GACN;QAAE,QAAQ,EAAE,CAAC,CAAA;KAAE,GACjB,MAAM,CAAC,CAAC;gBAEI,MAAM,EAAE,OAAO,EAAE,GAAG;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE,EAC3C,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,OAAO;IAGlC,IAAW,OAAO,IAAI,YAAY,EAAE,CAuBnC;IAED,OAAO,KAAK,MAAM,GAoBjB;IAED,SAAS,CAAC,QAAQ,KAAK,eAAe,IAAI,eAAe,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAEjF,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;CAGhC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/factory/options/option/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAY9B,MAAM,CAAC,OAAO,OAAgB,MAAM;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/factory/options/option/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAY9B,MAAM,CAAC,OAAO,OAAgB,MAAM;IA0BhB;IACA;IACA;IACA;IAJlB,YACkB,MAA2C,EAC3C,KAAe,EACf,OAAiB,EACjB,OAAgB;QAHhB,WAAM,GAAN,MAA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
|
2
2
|
import type { Globals } from "./globals.js";
|
3
3
|
export type { LanguageOptions, Globals, };
|
4
|
-
export type OptionTemplate<ParserOptions extends boolean | object, GlobalTypes extends Globals, Processor extends object, Language extends object> = {
|
4
|
+
export type OptionTemplate<ParserOptions extends boolean | object, GlobalTypes extends Globals | false, Processor extends object, Language extends object> = ({
|
5
5
|
languageOptions: LanguageOptions<ParserOptions, GlobalTypes>;
|
6
|
-
} & (
|
7
|
-
processor:
|
8
|
-
} ?
|
9
|
-
|
10
|
-
}
|
6
|
+
} & (Processor extends never ? object : Processor extends {
|
7
|
+
processor: infer P;
|
8
|
+
} ? string extends P ? object : {
|
9
|
+
processor: P;
|
10
|
+
} : object) & (Language extends never ? object : Language extends {
|
11
|
+
language: infer L;
|
12
|
+
} ? string extends L ? object : {
|
13
|
+
language: L;
|
14
|
+
} : object));
|
11
15
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/template/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,YAAY,EACV,eAAe,EACf,OAAO,GACR,CAAC;AACF,MAAM,MAAM,cAAc,CACxB,aAAa,SACX,OAAO,GACP,MAAM,EACR,WAAW,SAAS,OAAO,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/template/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,YAAY,EACV,eAAe,EACf,OAAO,GACR,CAAC;AACF,MAAM,MAAM,cAAc,CACxB,aAAa,SACX,OAAO,GACP,MAAM,EACR,WAAW,SAAS,OAAO,GAAG,KAAK,EACnC,SAAS,SAAS,MAAM,EACxB,QAAQ,SAAS,MAAM,IACrB,CACJ;IAAE,eAAe,EAAE,eAAe,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;CAAE,GAC9D,CACE,SAAS,SAAS,KAAK,GACnB,MAAM,GACN,SAAS,SAAS;IAAE,SAAS,EAAE,MAAM,CAAC,CAAA;CAAE,GACtC,MAAM,SAAS,CAAC,GACd,MAAM,GACN;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,GAClB,MAAM,CACX,GACC,CACF,QAAQ,SAAS,KAAK,GAClB,MAAM,GACN,QAAQ,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;CAAE,GACpC,MAAM,SAAS,CAAC,GACd,MAAM,GACN;IAAE,QAAQ,EAAE,CAAC,CAAA;CAAE,GACjB,MAAM,CACX,CACJ,CAAC"}
|
@@ -1,9 +1,10 @@
|
|
1
|
-
|
1
|
+
import type { Globals } from "./globals.js";
|
2
|
+
export type LanguageOptions<ParserOptions extends object | boolean, GlobalTypes extends Globals | false> = (GlobalTypes extends never ? object : GlobalTypes extends false ? object : {
|
2
3
|
globals: Record<string, unknown>;
|
3
|
-
}) & (ParserOptions extends
|
4
|
+
}) & (ParserOptions extends never ? object : ParserOptions extends boolean ? ParserOptions extends true ? {
|
4
5
|
parser: unknown;
|
5
|
-
} :
|
6
|
+
} : object : {
|
6
7
|
parser: unknown;
|
7
8
|
parserOptions: ParserOptions;
|
8
|
-
}
|
9
|
-
//# sourceMappingURL=languageOptions.d.ts.map
|
9
|
+
});
|
10
|
+
//# sourceMappingURL=languageOptions.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"languageOptions.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/template/languageOptions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,CACzB,aAAa,SAAS,MAAM,GAAG,OAAO,EACtC,WAAW,SAAS,
|
1
|
+
{"version":3,"file":"languageOptions.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/template/languageOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,eAAe,CACzB,aAAa,SAAS,MAAM,GAAG,OAAO,EACtC,WAAW,SAAS,OAAO,GAAG,KAAK,IAElC,CAAC,WAAW,SAAS,KAAK,GACxB,MAAM,GACN,WAAW,SAAS,KAAK,GACvB,MAAM,GACN;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAC1C,GACC,CACE,aAAa,SAAS,KAAK,GACvB,MAAM,GACN,aAAa,SAAS,OAAO,GAC3B,aAAa,SAAS,IAAI,GACxB;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB,MAAM,GACR;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,aAAa,CAAA;CAAE,CACzD,CAAC"}
|
@@ -5,7 +5,7 @@ export default class Svelte extends Option<"svelte", {
|
|
5
5
|
extraFileExtensions: readonly [
|
6
6
|
".svelte"
|
7
7
|
];
|
8
|
-
} & Ts["option"]["languageOptions"]["parserOptions"], 2,
|
8
|
+
} & Ts["option"]["languageOptions"]["parserOptions"], 2, false, {
|
9
9
|
processor: "svelte/svelte";
|
10
10
|
}> {
|
11
11
|
readonly scope = "svelte";
|
package/dist/index.d.ts
CHANGED
@@ -2,5 +2,5 @@ export type { Scope } from "./scopes/index.js";
|
|
2
2
|
export type { Plugins, RuleEntry, RuleRecord, RuleState, GlobalConfigSystem, GlobalConfigIgnores, ScopedConfig, } from "./objects/index.js";
|
3
3
|
import type { Input, Output } from "./interface/index.js";
|
4
4
|
export type { Input, Output, };
|
5
|
-
export default function (
|
5
|
+
export default function ({ plugins, parsers, settings, globals, files, ignores, rules, }: Input): Output;
|
6
6
|
//# 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":"AAAA,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EACV,OAAO,EACP,SAAS,EACT,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACb,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EACV,KAAK,EACL,MAAM,EACP,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,KAAK,EACL,MAAM,GACP,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EACV,OAAO,EACP,SAAS,EACT,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACb,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EACV,KAAK,EACL,MAAM,EACP,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,KAAK,EACL,MAAM,GACP,CAAC;AASF,MAAM,CAAC,OAAO,WACZ,EACE,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,KAAK,GACN,EAAE,KAAK,GACP,MAAM,CA6DR"}
|
package/dist/index.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { scopes } from "./scopes/index.js";
|
2
|
-
import { Factory, Options, } from "./factory/index.js";
|
3
|
-
export default function (
|
2
|
+
import { Global, Factory, Options, } from "./factory/index.js";
|
3
|
+
export default function ({ plugins, parsers, settings, globals, files, ignores, rules, }) {
|
4
4
|
try {
|
5
|
-
const
|
5
|
+
const global = new Global(plugins, settings, globals), factory = new Factory(files, ignores, rules), options = {
|
6
6
|
js: new Options
|
7
7
|
.js([], ...factory.produce("js")).configs,
|
8
8
|
ts: new Options
|
@@ -21,29 +21,7 @@ export default function (input) {
|
|
21
21
|
.yml([parsers.yml], ...factory.produce("yml")).configs,
|
22
22
|
};
|
23
23
|
return [
|
24
|
-
|
25
|
-
name: "linted/global/settings",
|
26
|
-
plugins,
|
27
|
-
linterOptions: {
|
28
|
-
noInlineConfig: settings.noInlineConfig,
|
29
|
-
reportUnusedDisableDirectives: settings.reportUnusedDisableDirectives,
|
30
|
-
},
|
31
|
-
languageOptions: {
|
32
|
-
sourceType: settings.sourceType,
|
33
|
-
ecmaVersion: settings.ecmaVersion,
|
34
|
-
},
|
35
|
-
},
|
36
|
-
{
|
37
|
-
name: "linted/global/ignores",
|
38
|
-
ignores: typeof globals.extend.ignores === "undefined" || globals.extend.ignores.length < 1
|
39
|
-
? globals.ignores.ignores
|
40
|
-
: [
|
41
|
-
...globals.extend.inherit === false
|
42
|
-
? []
|
43
|
-
: globals.ignores.ignores,
|
44
|
-
...globals.extend.ignores,
|
45
|
-
],
|
46
|
-
},
|
24
|
+
...global.configs,
|
47
25
|
...scopes.flatMap(scope => options[scope]),
|
48
26
|
];
|
49
27
|
}
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,OAAO,EACP,OAAO,GACR,MAAM,WAAW,CAAC;AAEnB,MAAM,CAAC,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,MAAM,EACN,OAAO,EACP,OAAO,GACR,MAAM,WAAW,CAAC;AAEnB,MAAM,CAAC,OAAO,WACZ,EACE,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,KAAK,GACC;IAER,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB,OAAO,EAC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CAAC,CAC1B,CAAC,OAAO;SACZ,CAAC;QAEF,OAAO;YACL,GAAG,MAAM,CAAC,OAAO;YACjB,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SAC3C,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QAAC,MAAM,IAAI,KAAK,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAAC,CAAC;AAC7D,CAAC"}
|
@@ -8,7 +8,7 @@ export type GlobalConfigSystem = Partial<Record<Exclude<ConfigProperty, "name" |
|
|
8
8
|
};
|
9
9
|
languageOptions: {
|
10
10
|
sourceType?: "module" | "script";
|
11
|
-
ecmaVersion?: "latest" | 3 | 5 |
|
11
|
+
ecmaVersion?: "latest" | 3 | 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024;
|
12
12
|
};
|
13
13
|
};
|
14
14
|
//# sourceMappingURL=system.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/objects/config/global/system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,IAAI,CAAC;AAEZ,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAC7C,OAAO,CACL,cAAc,EACZ,MAAM,GACN,SAAS,GACT,eAAe,GACf,iBAAiB,CACpB,EACD,KAAK,CACN,CAAC,GAAG;IACH,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE;QACb,cAAc,EAAE,OAAO,CAAC;QACxB,6BAA6B,EACzB,OAAO,GACP,MAAM,GACN,KAAK,CACR;KACF,CAAC;IACF,eAAe,EAAE;QACf,UAAU,CAAC,EACP,QAAQ,GACR,QAAQ,CACX;QACD,WAAW,CAAC,EACR,QAAQ,GACR,CAAC,GACD,CAAC,GACD,
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/objects/config/global/system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,IAAI,CAAC;AAEZ,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAC7C,OAAO,CACL,cAAc,EACZ,MAAM,GACN,SAAS,GACT,eAAe,GACf,iBAAiB,CACpB,EACD,KAAK,CACN,CAAC,GAAG;IACH,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE;QACb,cAAc,EAAE,OAAO,CAAC;QACxB,6BAA6B,EACzB,OAAO,GACP,MAAM,GACN,KAAK,CACR;KACF,CAAC;IACF,eAAe,EAAE;QACf,UAAU,CAAC,EACP,QAAQ,GACR,QAAQ,CACX;QACD,WAAW,CAAC,EACR,QAAQ,GACR,CAAC,GACD,CAAC,GACD,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CACP;KACF,CAAC;CACH,CAAC"}
|
@@ -4,11 +4,7 @@ export interface ScopedConfig {
|
|
4
4
|
rules: RuleRecord;
|
5
5
|
files: string[];
|
6
6
|
ignores: string[];
|
7
|
-
languageOptions:
|
8
|
-
parser?: unknown;
|
9
|
-
parserOptions?: Table;
|
10
|
-
globals?: Table<true>;
|
11
|
-
};
|
7
|
+
languageOptions: object;
|
12
8
|
processor?: string;
|
13
9
|
language?: string;
|
14
10
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scoped.d.ts","sourceRoot":"","sources":["../../../src/objects/config/scoped.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,MAAM,WAAW,YAAY;IAC3B,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
|
1
|
+
{"version":3,"file":"scoped.d.ts","sourceRoot":"","sources":["../../../src/objects/config/scoped.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,MAAM,WAAW,YAAY;IAC3B,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,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
@@ -1 +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,
|
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,MAAM,CAC7B,MAAM,EACJ,SAAS,GACT,SAAS,CAAC,SAAS,EAAE,GAAG,OAAO,EAAE,CAAC,CACrC,CAAC"}
|
package/package.json
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
import type { Input } from ".";
|
2
|
+
|
3
|
+
export class Global {
|
4
|
+
constructor(
|
5
|
+
public readonly plugins: Input["plugins"],
|
6
|
+
public readonly settings: Input["settings"],
|
7
|
+
public readonly globals: Input["globals"],
|
8
|
+
) {}
|
9
|
+
|
10
|
+
public get configs() {
|
11
|
+
const {
|
12
|
+
plugins,
|
13
|
+
settings,
|
14
|
+
globals,
|
15
|
+
} = this;
|
16
|
+
|
17
|
+
return [
|
18
|
+
{
|
19
|
+
name: "linted/global/settings",
|
20
|
+
plugins,
|
21
|
+
linterOptions: {
|
22
|
+
noInlineConfig: settings.noInlineConfig,
|
23
|
+
reportUnusedDisableDirectives: settings.reportUnusedDisableDirectives,
|
24
|
+
},
|
25
|
+
languageOptions: {
|
26
|
+
sourceType: settings.sourceType,
|
27
|
+
ecmaVersion: settings.ecmaVersion,
|
28
|
+
},
|
29
|
+
},
|
30
|
+
{
|
31
|
+
name: "linted/global/ignores",
|
32
|
+
ignores: typeof globals.extend.ignores === "undefined" || globals.extend.ignores.length < 1
|
33
|
+
? globals.ignores.ignores
|
34
|
+
: [
|
35
|
+
...globals.extend.inherit === false
|
36
|
+
? []
|
37
|
+
: globals.ignores.ignores,
|
38
|
+
...globals.extend.ignores,
|
39
|
+
],
|
40
|
+
},
|
41
|
+
] as const;
|
42
|
+
}
|
43
|
+
}
|
package/src/factory/index.ts
CHANGED
@@ -15,25 +15,28 @@ export default abstract class Option<
|
|
15
15
|
ParserOptions extends
|
16
16
|
| object
|
17
17
|
| boolean = false,
|
18
|
-
ParserCount extends 0 | 1 | 2 = 0,
|
19
|
-
Global extends Globals =
|
20
|
-
Processor extends object =
|
21
|
-
Language extends object =
|
18
|
+
ParserCount extends 0 | 1 | 2 = ParserOptions extends false ? 0 : 1,
|
19
|
+
Global extends Globals | false = false,
|
20
|
+
Processor extends object = object,
|
21
|
+
Language extends object = object,
|
22
22
|
> {
|
23
|
-
public abstract readonly scope:
|
24
|
-
public abstract readonly processor:
|
23
|
+
public abstract readonly scope: S;
|
24
|
+
public abstract readonly processor: (Processor extends never
|
25
25
|
? object
|
26
|
-
:
|
27
|
-
?
|
28
|
-
|
29
|
-
|
26
|
+
: Processor extends { processor: infer P }
|
27
|
+
? string extends P
|
28
|
+
? object
|
29
|
+
: { processor: P }
|
30
|
+
: object);
|
31
|
+
public abstract readonly language: (Language extends never
|
30
32
|
? object
|
31
|
-
:
|
32
|
-
?
|
33
|
-
|
34
|
-
|
33
|
+
: Language extends { language: infer L }
|
34
|
+
? string extends L
|
35
|
+
? object
|
36
|
+
: { language: L }
|
37
|
+
: object);
|
35
38
|
constructor(
|
36
|
-
public readonly parser:
|
39
|
+
public readonly parser: unknown[] & { length: ParserCount },
|
37
40
|
public readonly files: string[],
|
38
41
|
public readonly ignores: string[],
|
39
42
|
public readonly ruleset: Ruleset,
|
@@ -88,7 +91,7 @@ export default abstract class Option<
|
|
88
91
|
|
89
92
|
protected abstract get languageOptions(): LanguageOptions<ParserOptions, Global>;
|
90
93
|
|
91
|
-
protected globals(type:
|
94
|
+
protected globals(type: Globals) {
|
92
95
|
return globals[type];
|
93
96
|
}
|
94
97
|
}
|
@@ -9,12 +9,27 @@ export type OptionTemplate<
|
|
9
9
|
ParserOptions extends
|
10
10
|
| boolean
|
11
11
|
| object,
|
12
|
-
GlobalTypes extends Globals,
|
12
|
+
GlobalTypes extends Globals | false,
|
13
13
|
Processor extends object,
|
14
14
|
Language extends object,
|
15
|
-
> =
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
> = (
|
16
|
+
{ languageOptions: LanguageOptions<ParserOptions, GlobalTypes> }
|
17
|
+
& (
|
18
|
+
Processor extends never
|
19
|
+
? object
|
20
|
+
: Processor extends { processor: infer P }
|
21
|
+
? string extends P
|
22
|
+
? object
|
23
|
+
: { processor: P }
|
24
|
+
: object
|
25
|
+
)
|
26
|
+
& (
|
27
|
+
Language extends never
|
28
|
+
? object
|
29
|
+
: Language extends { language: infer L }
|
30
|
+
? string extends L
|
31
|
+
? object
|
32
|
+
: { language: L }
|
33
|
+
: object
|
34
|
+
)
|
35
|
+
);
|
@@ -1,16 +1,21 @@
|
|
1
|
+
import type { Globals } from "./globals";
|
2
|
+
|
1
3
|
export type LanguageOptions<
|
2
4
|
ParserOptions extends object | boolean,
|
3
|
-
GlobalTypes extends
|
5
|
+
GlobalTypes extends Globals | false,
|
4
6
|
> =
|
5
|
-
& (
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
& (GlobalTypes extends never
|
8
|
+
? object
|
9
|
+
: GlobalTypes extends false
|
10
|
+
? object
|
11
|
+
: { globals: Record<string, unknown> }
|
12
|
+
)
|
13
|
+
& (
|
14
|
+
ParserOptions extends never
|
15
|
+
? object
|
16
|
+
: ParserOptions extends boolean
|
17
|
+
? ParserOptions extends true
|
18
|
+
? { parser: unknown }
|
19
|
+
: object
|
20
|
+
: { parser: unknown; parserOptions: ParserOptions }
|
21
|
+
);
|
package/src/index.ts
CHANGED
@@ -21,21 +21,28 @@ export type {
|
|
21
21
|
|
22
22
|
import { scopes } from "./scopes";
|
23
23
|
import {
|
24
|
+
Global,
|
24
25
|
Factory,
|
25
26
|
Options,
|
26
27
|
} from "./factory";
|
27
28
|
|
28
|
-
export default function (
|
29
|
+
export default function (
|
30
|
+
{
|
31
|
+
plugins,
|
32
|
+
parsers,
|
33
|
+
settings,
|
34
|
+
globals,
|
35
|
+
files,
|
36
|
+
ignores,
|
37
|
+
rules,
|
38
|
+
}: Input,
|
39
|
+
): Output {
|
29
40
|
try {
|
30
|
-
const
|
41
|
+
const global = new Global(
|
31
42
|
plugins,
|
32
|
-
parsers,
|
33
43
|
settings,
|
34
44
|
globals,
|
35
|
-
|
36
|
-
ignores,
|
37
|
-
rules,
|
38
|
-
} = input,
|
45
|
+
),
|
39
46
|
factory = new Factory(
|
40
47
|
files,
|
41
48
|
ignores,
|
@@ -85,29 +92,7 @@ export default function (input: Input): Output {
|
|
85
92
|
};
|
86
93
|
|
87
94
|
return [
|
88
|
-
|
89
|
-
name: "linted/global/settings",
|
90
|
-
plugins,
|
91
|
-
linterOptions: {
|
92
|
-
noInlineConfig: settings.noInlineConfig,
|
93
|
-
reportUnusedDisableDirectives: settings.reportUnusedDisableDirectives,
|
94
|
-
},
|
95
|
-
languageOptions: {
|
96
|
-
sourceType: settings.sourceType,
|
97
|
-
ecmaVersion: settings.ecmaVersion,
|
98
|
-
},
|
99
|
-
},
|
100
|
-
{
|
101
|
-
name: "linted/global/ignores",
|
102
|
-
ignores: typeof globals.extend.ignores === "undefined" || globals.extend.ignores.length < 1
|
103
|
-
? globals.ignores.ignores
|
104
|
-
: [
|
105
|
-
...globals.extend.inherit === false
|
106
|
-
? []
|
107
|
-
: globals.ignores.ignores,
|
108
|
-
...globals.extend.ignores,
|
109
|
-
],
|
110
|
-
},
|
95
|
+
...global.configs,
|
111
96
|
...scopes.flatMap(scope => options[scope]),
|
112
97
|
];
|
113
98
|
}
|
@@ -32,17 +32,16 @@ export type GlobalConfigSystem = Partial<Record<
|
|
32
32
|
| "latest"
|
33
33
|
| 3
|
34
34
|
| 5
|
35
|
-
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
)}`>;
|
35
|
+
| 2015
|
36
|
+
| 2016
|
37
|
+
| 2017
|
38
|
+
| 2018
|
39
|
+
| 2019
|
40
|
+
| 2020
|
41
|
+
| 2021
|
42
|
+
| 2022
|
43
|
+
| 2023
|
44
|
+
| 2024
|
45
|
+
;
|
47
46
|
};
|
48
47
|
};
|
@@ -5,11 +5,7 @@ export interface ScopedConfig {
|
|
5
5
|
rules: RuleRecord;
|
6
6
|
files: string[];
|
7
7
|
ignores: string[];
|
8
|
-
languageOptions:
|
9
|
-
parser?: unknown;
|
10
|
-
parserOptions?: Table;
|
11
|
-
globals?: Table<true>;
|
12
|
-
};
|
8
|
+
languageOptions: object;
|
13
9
|
processor?: string;
|
14
10
|
language?: string;
|
15
11
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
declare type lower = Lowercase<upper>;
|