@eslinted/core 3.1.11 → 3.1.13-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/PROD.main.yml +37 -0
- package/.github/workflows/dev.yml +37 -0
- package/LICENSE +21 -21
- package/README.md +3 -3
- package/SECURITY.md +9 -9
- package/eslint.config.js +3 -3
- package/package.json +54 -54
- package/src/boundary/index.ts +6 -6
- package/src/boundary/input/files/base/index.ts +5 -5
- package/src/boundary/input/files/includes/index.ts +5 -5
- package/src/boundary/input/files/index.ts +11 -11
- package/src/boundary/input/index.ts +23 -23
- package/src/boundary/input/parsers/index.ts +5 -5
- package/src/boundary/input/plugins/index.ts +5 -5
- package/src/boundary/input/rules/index.ts +11 -11
- package/src/boundary/input/rules/overrides/index.ts +6 -6
- package/src/boundary/input/rules/preset/entry/index.ts +5 -5
- package/src/boundary/input/rules/preset/entry/object/index.ts +9 -9
- package/src/boundary/input/rules/preset/entry/object/state/index.ts +6 -6
- package/src/boundary/input/rules/preset/index.ts +6 -6
- package/src/boundary/output/config/index.ts +25 -25
- package/src/boundary/output/config/option/index.ts +24 -24
- package/src/boundary/output/config/option/language/ecma/index.ts +3 -3
- package/src/boundary/output/config/option/language/index.ts +23 -23
- package/src/boundary/output/config/option/language/source/index.ts +3 -3
- package/src/boundary/output/config/option/linter/index.ts +4 -4
- package/src/boundary/output/config/option/plugins/index.ts +3 -3
- package/src/boundary/output/index.ts +3 -3
- package/src/dependency/globals/index.ts +8 -8
- package/src/dependency/index.ts +5 -5
- package/src/dependency/parsers/index.ts +13 -13
- package/src/dependency/plugins/index.ts +12 -12
- package/src/factory/files/index.ts +15 -15
- package/src/factory/index.ts +8 -8
- package/src/factory/options/index.ts +21 -21
- package/src/factory/options/option/html/index.ts +18 -18
- package/src/factory/options/option/index.ts +93 -93
- package/src/factory/options/option/js/index.ts +13 -13
- package/src/factory/options/option/json/index.ts +18 -18
- package/src/factory/options/option/jsonc/index.ts +18 -18
- package/src/factory/options/option/md/index.ts +18 -18
- package/src/factory/options/option/mocha/index.ts +28 -28
- package/src/factory/options/option/svelte/index.ts +32 -32
- package/src/factory/options/option/ts/index.ts +24 -24
- package/src/factory/options/option/yml/index.ts +18 -18
- package/src/factory/rulesets/index.ts +16 -16
- package/src/factory/rulesets/ruleset/index.ts +40 -40
- package/src/factory/rulesets/ruleset/rule/index.ts +8 -8
- package/src/index.ts +95 -95
- package/src/scopes/index.ts +14 -14
- package/tsconfig.json +161 -161
- package/types/typioca/literal/number/base32.d.ts +19 -19
- package/types/typioca/literal/number/base64.d.ts +35 -35
- package/types/typioca/literal/number/binary.d.ts +4 -4
- package/types/typioca/literal/number/decimal.d.ts +5 -5
- package/types/typioca/literal/number/hex.d.ts +10 -10
- package/types/typioca/literal/number/octal.d.ts +7 -7
- package/types/typioca/literal/number/quatral.d.ts +4 -4
- package/types/typioca/literal/number/ternary.d.ts +4 -4
- package/types/typioca/literal/string/base64char.d.ts +13 -13
- package/types/typioca/literal/string/digit.d.ts +12 -12
- package/types/typioca/literal/string/hexchar.d.ts +9 -9
- package/types/typioca/literal/string/letter.d.ts +35 -35
- package/types/typioca/safe/Safe.d.ts +2 -2
- package/types/typioca/safe/numbers/finite/Finite.d.ts +2 -2
- package/types/typioca/safe/numbers/finite.d.ts +1 -1
- package/types/typioca/safe/numbers/fint.d.ts +1 -1
- package/types/typioca/safe/numbers/int/Int.d.ts +2 -2
- package/types/typioca/safe/numbers/int.d.ts +1 -1
- package/types/typioca/safe/numbers/numberful.d.ts +1 -1
- package/types/typioca/safe/numbers/polarity/Negative.d.ts +4 -4
- package/types/typioca/safe/numbers/polarity/Positive.d.ts +4 -4
- package/types/typioca/safe/numbers/polarity/pole/Pole.d.ts +18 -18
- package/types/typioca/safe/primitive.d.ts +5 -5
- package/types/typioca/safe/strings/char.d.ts +1 -1
- package/types/typioca/safe/strings/length/PropLength.d.ts +3 -3
- package/types/typioca/safe/strings/stringful.d.ts +1 -1
- package/types/typioca/utility/interface/construct/Particord.d.ts +1 -1
- package/types/typioca/utility/interface/construct/Property.d.ts +8 -8
- package/types/typioca/utility/interface/construct/Recordful.d.ts +5 -5
- package/types/typioca/utility/interface/construct/Table.d.ts +3 -3
- package/types/typioca/utility/interface/construct/properties/Field.d.ts +1 -1
- package/types/typioca/utility/interface/construct/properties/Flag.d.ts +1 -1
- package/types/typioca/utility/interface/construct/properties/Limit.d.ts +8 -8
- package/types/typioca/utility/interface/construct/properties/List.d.ts +1 -1
- package/types/typioca/utility/interface/construct/properties/Listish.d.ts +1 -1
- package/types/typioca/utility/interface/construct/properties/Scalar.d.ts +1 -1
- package/types/typioca/utility/interface/construct/tables/FieldTable.d.ts +1 -1
- package/types/typioca/utility/interface/construct/tables/FlagTable.d.ts +1 -1
- package/types/typioca/utility/interface/construct/tables/ListTable.d.ts +1 -1
- package/types/typioca/utility/interface/construct/tables/ListishTable.d.ts +1 -1
- package/types/typioca/utility/interface/construct/tables/ScalarTable.d.ts +1 -1
- package/types/typioca/utility/interface/identity/Interface.d.ts +80 -80
- package/types/typioca/utility/interface/identity/Keys.d.ts +71 -71
- package/types/typioca/utility/interface/transform/Unrequire.d.ts +45 -45
- package/types/typioca/utility/iterable/construct/ArrayN.d.ts +12 -12
- package/types/typioca/utility/iterable/construct/Tuple.d.ts +27 -27
- package/types/typioca/utility/iterable/construct/arrays/Arrays.d.ts +1 -1
- package/types/typioca/utility/iterable/construct/tuples/Tuples.d.ts +9 -9
- package/types/typioca/utility/iterable/identity/DyadType.d.ts +3 -3
- package/types/typioca/utility/iterable/identity/MonadType.d.ts +48 -48
- package/types/typioca/utility/iterable/identity/TriadType.d.ts +3 -3
- package/types/typioca/utility/iterable/identity/array/ArrayType.d.ts +65 -65
- package/types/typioca/utility/iterable/identity/array/length/ArrayLength.d.ts +16 -16
- package/types/typioca/utility/iterable/transform/Join.d.ts +19 -19
- package/types/typioca/utility/iterable/transform/Unflat.d.ts +3 -3
- package/types/typioca/utility/iterable/transform/stringarray/Chain.d.ts +30 -30
- package/types/typioca/utility/iterable/transform/stringarray/PathN.d.ts +3 -3
- package/types/typioca/utility/iterable/transform/stringarray/stringify/Stringify.d.ts +5 -5
- package/types/typioca/utility/length/Length.d.ts +35 -35
- package/types/typioca/utility/null/null.d.ts +1 -1
- package/types/typioca/utility/null/nullable.d.ts +1 -1
- package/types/typioca/utility/primitive/Primeval.d.ts +42 -42
- package/types/typioca/utility/primitive/boolean/True.d.ts +30 -30
- package/types/typioca/utility/primitive/number/Numbered.d.ts +35 -35
- package/types/typioca/utility/primitive/string/literal.d.ts +22 -22
- package/types/typioca/utility/primitive/string/literalful.d.ts +28 -28
@@ -1,3 +1,3 @@
|
|
1
|
-
type Source = "module" | "script";
|
2
|
-
|
3
|
-
export type { Source, Source as default };
|
1
|
+
type Source = "module" | "script";
|
2
|
+
|
3
|
+
export type { Source, Source as default };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export default interface Linter {
|
2
|
-
noInlineConfig: true;
|
3
|
-
reportUnusedDisableDirectives: "error";
|
4
|
-
}
|
1
|
+
export default interface Linter {
|
2
|
+
noInlineConfig: true;
|
3
|
+
reportUnusedDisableDirectives: "error";
|
4
|
+
}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
type Plugins<PluginId extends string> = Record<literalful<PluginId>, { configs: unknown }>;
|
2
|
-
|
3
|
-
export type { Plugins, Plugins as default };
|
1
|
+
type Plugins<PluginId extends string> = Record<literalful<PluginId>, { configs: unknown }>;
|
2
|
+
|
3
|
+
export type { Plugins, Plugins as default };
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type Config from "./config/index.js";
|
2
|
-
|
3
|
-
export type { Config, Config as default };
|
1
|
+
import type Config from "./config/index.js";
|
2
|
+
|
3
|
+
export type { Config, Config as default };
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import type globals from "globals";
|
2
|
-
|
3
|
-
type Globals =
|
4
|
-
| "mocha"
|
5
|
-
& keyof typeof globals
|
6
|
-
;
|
7
|
-
|
8
|
-
export type { Globals as default };
|
1
|
+
import type globals from "globals";
|
2
|
+
|
3
|
+
type Globals =
|
4
|
+
| "mocha"
|
5
|
+
& keyof typeof globals
|
6
|
+
;
|
7
|
+
|
8
|
+
export type { Globals as default };
|
package/src/dependency/index.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import type Plugins from "./plugins/index.js";
|
2
|
-
import type Parsers from "./parsers/index.js";
|
3
|
-
import type Globals from "./globals/index.js";
|
4
|
-
|
5
|
-
export type { Plugins, Parsers, Globals };
|
1
|
+
import type Plugins from "./plugins/index.js";
|
2
|
+
import type Parsers from "./parsers/index.js";
|
3
|
+
import type Globals from "./globals/index.js";
|
4
|
+
|
5
|
+
export type { Plugins, Parsers, Globals };
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import type { Scope } from "../../scopes/index.js";
|
2
|
-
|
3
|
-
type Parsers =
|
4
|
-
| "ts"
|
5
|
-
| "svelte"
|
6
|
-
| "html"
|
7
|
-
| "jsonc"
|
8
|
-
| "yml"
|
9
|
-
| "md"
|
10
|
-
& Scope
|
11
|
-
;
|
12
|
-
|
13
|
-
export type { Parsers as default };
|
1
|
+
import type { Scope } from "../../scopes/index.js";
|
2
|
+
|
3
|
+
type Parsers =
|
4
|
+
| "ts"
|
5
|
+
| "svelte"
|
6
|
+
| "html"
|
7
|
+
| "jsonc"
|
8
|
+
| "yml"
|
9
|
+
| "md"
|
10
|
+
& Scope
|
11
|
+
;
|
12
|
+
|
13
|
+
export type { Parsers as default };
|
@@ -1,12 +1,12 @@
|
|
1
|
-
type Plugins =
|
2
|
-
| "@stylistic"
|
3
|
-
| "@typescript-eslint"
|
4
|
-
| "svelte"
|
5
|
-
| "mocha"
|
6
|
-
| "@html-eslint"
|
7
|
-
| "jsonc"
|
8
|
-
| "yml"
|
9
|
-
| "markdownlint"
|
10
|
-
;
|
11
|
-
|
12
|
-
export type { Plugins as default };
|
1
|
+
type Plugins =
|
2
|
+
| "@stylistic"
|
3
|
+
| "@typescript-eslint"
|
4
|
+
| "svelte"
|
5
|
+
| "mocha"
|
6
|
+
| "@html-eslint"
|
7
|
+
| "jsonc"
|
8
|
+
| "yml"
|
9
|
+
| "markdownlint"
|
10
|
+
;
|
11
|
+
|
12
|
+
export type { Plugins as default };
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import type { Scope } from "../../scopes/index.js";
|
2
|
-
import type { Input } from "../../boundary/index.js";
|
3
|
-
|
4
|
-
export default class Files {
|
5
|
-
constructor(private readonly input: Input.Files.Files) {}
|
6
|
-
|
7
|
-
public files(scope: Scope): readonly string[] {
|
8
|
-
try {
|
9
|
-
const { base, includes } = this.input;
|
10
|
-
|
11
|
-
return [...base[scope], ...includes[scope] ?? []];
|
12
|
-
}
|
13
|
-
catch (e) { throw new Error(`linted.factory.Files/scope:${scope}`, { cause: e }); }
|
14
|
-
}
|
15
|
-
}
|
1
|
+
import type { Scope } from "../../scopes/index.js";
|
2
|
+
import type { Input } from "../../boundary/index.js";
|
3
|
+
|
4
|
+
export default class Files {
|
5
|
+
constructor(private readonly input: Input.Files.Files) {}
|
6
|
+
|
7
|
+
public files(scope: Scope): readonly string[] {
|
8
|
+
try {
|
9
|
+
const { base, includes } = this.input;
|
10
|
+
|
11
|
+
return [...base[scope], ...includes[scope] ?? []];
|
12
|
+
}
|
13
|
+
catch (e) { throw new Error(`linted.factory.Files/scope:${scope}`, { cause: e }); }
|
14
|
+
}
|
15
|
+
}
|
package/src/factory/index.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import Rulesets from "./rulesets/index.js";
|
2
|
-
import Files from "./files/index.js";
|
3
|
-
import Options from "./options/index.js";
|
4
|
-
|
5
|
-
export class Factory {
|
6
|
-
|
7
|
-
}
|
8
|
-
export { Options, Files, Rulesets };
|
1
|
+
import Rulesets from "./rulesets/index.js";
|
2
|
+
import Files from "./files/index.js";
|
3
|
+
import Options from "./options/index.js";
|
4
|
+
|
5
|
+
export class Factory {
|
6
|
+
|
7
|
+
}
|
8
|
+
export { Options, Files, Rulesets };
|
@@ -1,21 +1,21 @@
|
|
1
|
-
import js from "./option/js/index.js";
|
2
|
-
import ts from "./option/ts/index.js";
|
3
|
-
import svelte from "./option/svelte/index.js";
|
4
|
-
import mocha from "./option/mocha/index.js";
|
5
|
-
import html from "./option/html/index.js";
|
6
|
-
import json from "./option/json/index.js";
|
7
|
-
import jsonc from "./option/jsonc/index.js";
|
8
|
-
import yml from "./option/yml/index.js";
|
9
|
-
import md from "./option/md/index.js";
|
10
|
-
|
11
|
-
export default {
|
12
|
-
js,
|
13
|
-
ts,
|
14
|
-
svelte,
|
15
|
-
mocha,
|
16
|
-
html,
|
17
|
-
json,
|
18
|
-
jsonc,
|
19
|
-
yml,
|
20
|
-
md,
|
21
|
-
} as const;
|
1
|
+
import js from "./option/js/index.js";
|
2
|
+
import ts from "./option/ts/index.js";
|
3
|
+
import svelte from "./option/svelte/index.js";
|
4
|
+
import mocha from "./option/mocha/index.js";
|
5
|
+
import html from "./option/html/index.js";
|
6
|
+
import json from "./option/json/index.js";
|
7
|
+
import jsonc from "./option/jsonc/index.js";
|
8
|
+
import yml from "./option/yml/index.js";
|
9
|
+
import md from "./option/md/index.js";
|
10
|
+
|
11
|
+
export default {
|
12
|
+
js,
|
13
|
+
ts,
|
14
|
+
svelte,
|
15
|
+
mocha,
|
16
|
+
html,
|
17
|
+
json,
|
18
|
+
jsonc,
|
19
|
+
yml,
|
20
|
+
md,
|
21
|
+
} as const;
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import Option from "../index.js";
|
2
|
-
|
3
|
-
export default class Html extends Option<
|
4
|
-
"html",
|
5
|
-
"@html-eslint",
|
6
|
-
false,
|
7
|
-
true,
|
8
|
-
1
|
9
|
-
> {
|
10
|
-
public readonly scope = "html";
|
11
|
-
public readonly processor = {} as const;
|
12
|
-
|
13
|
-
public get languageOptions() {
|
14
|
-
const [parser] = this.parser;
|
15
|
-
|
16
|
-
return { parser } as const;
|
17
|
-
}
|
18
|
-
}
|
1
|
+
import Option from "../index.js";
|
2
|
+
|
3
|
+
export default class Html extends Option<
|
4
|
+
"html",
|
5
|
+
"@html-eslint",
|
6
|
+
false,
|
7
|
+
true,
|
8
|
+
1
|
9
|
+
> {
|
10
|
+
public readonly scope = "html";
|
11
|
+
public readonly processor = {} as const;
|
12
|
+
|
13
|
+
public get languageOptions() {
|
14
|
+
const [parser] = this.parser;
|
15
|
+
|
16
|
+
return { parser } as const;
|
17
|
+
}
|
18
|
+
}
|
@@ -1,93 +1,93 @@
|
|
1
|
-
import globals from "globals";
|
2
|
-
import type { Scope } from "../../../scopes/index.js";
|
3
|
-
import type Ruleset from "../../rulesets/ruleset/index.js";
|
4
|
-
import type { Plugins } from "../../../dependency/index.js";
|
5
|
-
import type { Output } from "../../../boundary/index.js";
|
6
|
-
|
7
|
-
export default abstract class Option<
|
8
|
-
S extends Scope,
|
9
|
-
PluginId extends Plugins,
|
10
|
-
IsEcma extends boolean = true,
|
11
|
-
ParserOptions extends object | boolean = false,
|
12
|
-
ParserCount extends 0 | 1 | 2 = 0,
|
13
|
-
GlobalTypes extends keyof typeof globals = never,
|
14
|
-
Processor extends object = never,
|
15
|
-
> {
|
16
|
-
private readonly linterOptions = { noInlineConfig: true, reportUnusedDisableDirectives: "error" } as const;
|
17
|
-
|
18
|
-
public abstract readonly scope: literalful<S>;
|
19
|
-
public abstract readonly processor: Interface<Processor> extends never
|
20
|
-
? object
|
21
|
-
: Interface<Processor> extends Readonly<Record<"processor", string>>
|
22
|
-
? Interface<Processor>
|
23
|
-
: object;
|
24
|
-
|
25
|
-
constructor(
|
26
|
-
public readonly files: readonly string[],
|
27
|
-
public readonly ruleset: Ruleset<S>,
|
28
|
-
public readonly plugins: Output.Config.Plugins<PluginId>,
|
29
|
-
public readonly parser: Tuple<unknown, ParserCount>,
|
30
|
-
) {}
|
31
|
-
|
32
|
-
public get configs(): Output[] {
|
33
|
-
try {
|
34
|
-
const {
|
35
|
-
scope,
|
36
|
-
ruleset,
|
37
|
-
files,
|
38
|
-
option,
|
39
|
-
} = this;
|
40
|
-
|
41
|
-
if (ruleset.id !== scope)
|
42
|
-
throw new TypeError(`Option and Ruleset scope mismatch`, { cause: { option: scope, ruleset: ruleset.id } });
|
43
|
-
else if (files.length < 1)
|
44
|
-
return [];
|
45
|
-
else {
|
46
|
-
const baseName = `linted/scope:${scope}/rule:${ruleset.id}` as const;
|
47
|
-
|
48
|
-
return ruleset.records.map(([ruleId, rules]) => {
|
49
|
-
const name = `${baseName}+${ruleId}` as const;
|
50
|
-
|
51
|
-
return {
|
52
|
-
name,
|
53
|
-
files,
|
54
|
-
rules,
|
55
|
-
...option,
|
56
|
-
};
|
57
|
-
});
|
58
|
-
}
|
59
|
-
}
|
60
|
-
catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: configs`, { cause: e }); }
|
61
|
-
}
|
62
|
-
|
63
|
-
private get option() {
|
64
|
-
try {
|
65
|
-
const {
|
66
|
-
plugins,
|
67
|
-
linterOptions,
|
68
|
-
languageOptions,
|
69
|
-
processor,
|
70
|
-
} = this;
|
71
|
-
|
72
|
-
return {
|
73
|
-
plugins,
|
74
|
-
linterOptions,
|
75
|
-
languageOptions,
|
76
|
-
...processor,
|
77
|
-
} satisfies Output.Config.IOption<
|
78
|
-
PluginId,
|
79
|
-
IsEcma,
|
80
|
-
ParserOptions,
|
81
|
-
GlobalTypes,
|
82
|
-
Processor
|
83
|
-
>;
|
84
|
-
}
|
85
|
-
catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e }); }
|
86
|
-
}
|
87
|
-
|
88
|
-
protected abstract get languageOptions(): Output.Config.Language<IsEcma, ParserOptions, GlobalTypes>;
|
89
|
-
|
90
|
-
protected globals(type: GlobalTypes) {
|
91
|
-
return globals[type];
|
92
|
-
}
|
93
|
-
}
|
1
|
+
import globals from "globals";
|
2
|
+
import type { Scope } from "../../../scopes/index.js";
|
3
|
+
import type Ruleset from "../../rulesets/ruleset/index.js";
|
4
|
+
import type { Plugins } from "../../../dependency/index.js";
|
5
|
+
import type { Output } from "../../../boundary/index.js";
|
6
|
+
|
7
|
+
export default abstract class Option<
|
8
|
+
S extends Scope,
|
9
|
+
PluginId extends Plugins,
|
10
|
+
IsEcma extends boolean = true,
|
11
|
+
ParserOptions extends object | boolean = false,
|
12
|
+
ParserCount extends 0 | 1 | 2 = 0,
|
13
|
+
GlobalTypes extends keyof typeof globals = never,
|
14
|
+
Processor extends object = never,
|
15
|
+
> {
|
16
|
+
private readonly linterOptions = { noInlineConfig: true, reportUnusedDisableDirectives: "error" } as const;
|
17
|
+
|
18
|
+
public abstract readonly scope: literalful<S>;
|
19
|
+
public abstract readonly processor: Interface<Processor> extends never
|
20
|
+
? object
|
21
|
+
: Interface<Processor> extends Readonly<Record<"processor", string>>
|
22
|
+
? Interface<Processor>
|
23
|
+
: object;
|
24
|
+
|
25
|
+
constructor(
|
26
|
+
public readonly files: readonly string[],
|
27
|
+
public readonly ruleset: Ruleset<S>,
|
28
|
+
public readonly plugins: Output.Config.Plugins<PluginId>,
|
29
|
+
public readonly parser: Tuple<unknown, ParserCount>,
|
30
|
+
) {}
|
31
|
+
|
32
|
+
public get configs(): Output[] {
|
33
|
+
try {
|
34
|
+
const {
|
35
|
+
scope,
|
36
|
+
ruleset,
|
37
|
+
files,
|
38
|
+
option,
|
39
|
+
} = this;
|
40
|
+
|
41
|
+
if (ruleset.id !== scope)
|
42
|
+
throw new TypeError(`Option and Ruleset scope mismatch`, { cause: { option: scope, ruleset: ruleset.id } });
|
43
|
+
else if (files.length < 1)
|
44
|
+
return [];
|
45
|
+
else {
|
46
|
+
const baseName = `linted/scope:${scope}/rule:${ruleset.id}` as const;
|
47
|
+
|
48
|
+
return ruleset.records.map(([ruleId, rules]) => {
|
49
|
+
const name = `${baseName}+${ruleId}` as const;
|
50
|
+
|
51
|
+
return {
|
52
|
+
name,
|
53
|
+
files,
|
54
|
+
rules,
|
55
|
+
...option,
|
56
|
+
};
|
57
|
+
});
|
58
|
+
}
|
59
|
+
}
|
60
|
+
catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: configs`, { cause: e }); }
|
61
|
+
}
|
62
|
+
|
63
|
+
private get option() {
|
64
|
+
try {
|
65
|
+
const {
|
66
|
+
plugins,
|
67
|
+
linterOptions,
|
68
|
+
languageOptions,
|
69
|
+
processor,
|
70
|
+
} = this;
|
71
|
+
|
72
|
+
return {
|
73
|
+
plugins,
|
74
|
+
linterOptions,
|
75
|
+
languageOptions,
|
76
|
+
...processor,
|
77
|
+
} satisfies Output.Config.IOption<
|
78
|
+
PluginId,
|
79
|
+
IsEcma,
|
80
|
+
ParserOptions,
|
81
|
+
GlobalTypes,
|
82
|
+
Processor
|
83
|
+
>;
|
84
|
+
}
|
85
|
+
catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e }); }
|
86
|
+
}
|
87
|
+
|
88
|
+
protected abstract get languageOptions(): Output.Config.Language<IsEcma, ParserOptions, GlobalTypes>;
|
89
|
+
|
90
|
+
protected globals(type: GlobalTypes) {
|
91
|
+
return globals[type];
|
92
|
+
}
|
93
|
+
}
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import Option from "../index.js";
|
2
|
-
|
3
|
-
export default class Js extends Option<"js", "@stylistic"> {
|
4
|
-
public readonly scope = "js";
|
5
|
-
public readonly processor = {};
|
6
|
-
|
7
|
-
public get languageOptions() {
|
8
|
-
return {
|
9
|
-
ecmaVersion: "latest",
|
10
|
-
sourceType: "module",
|
11
|
-
} as const;
|
12
|
-
}
|
13
|
-
}
|
1
|
+
import Option from "../index.js";
|
2
|
+
|
3
|
+
export default class Js extends Option<"js", "@stylistic"> {
|
4
|
+
public readonly scope = "js";
|
5
|
+
public readonly processor = {};
|
6
|
+
|
7
|
+
public get languageOptions() {
|
8
|
+
return {
|
9
|
+
ecmaVersion: "latest",
|
10
|
+
sourceType: "module",
|
11
|
+
} as const;
|
12
|
+
}
|
13
|
+
}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import Option from "../index.js";
|
2
|
-
|
3
|
-
export default class Json extends Option<
|
4
|
-
"json",
|
5
|
-
"jsonc",
|
6
|
-
false,
|
7
|
-
true,
|
8
|
-
1
|
9
|
-
> {
|
10
|
-
public readonly scope = "json";
|
11
|
-
public readonly processor = {} as const;
|
12
|
-
|
13
|
-
public get languageOptions() {
|
14
|
-
const [parser] = this.parser;
|
15
|
-
|
16
|
-
return { parser } as const;
|
17
|
-
}
|
18
|
-
}
|
1
|
+
import Option from "../index.js";
|
2
|
+
|
3
|
+
export default class Json extends Option<
|
4
|
+
"json",
|
5
|
+
"jsonc",
|
6
|
+
false,
|
7
|
+
true,
|
8
|
+
1
|
9
|
+
> {
|
10
|
+
public readonly scope = "json";
|
11
|
+
public readonly processor = {} as const;
|
12
|
+
|
13
|
+
public get languageOptions() {
|
14
|
+
const [parser] = this.parser;
|
15
|
+
|
16
|
+
return { parser } as const;
|
17
|
+
}
|
18
|
+
}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import Option from "../index.js";
|
2
|
-
|
3
|
-
export default class Jsonc extends Option<
|
4
|
-
"jsonc",
|
5
|
-
"jsonc",
|
6
|
-
false,
|
7
|
-
true,
|
8
|
-
1
|
9
|
-
> {
|
10
|
-
public readonly scope = "jsonc";
|
11
|
-
public readonly processor = {} as const;
|
12
|
-
|
13
|
-
public get languageOptions() {
|
14
|
-
const [parser] = this.parser;
|
15
|
-
|
16
|
-
return { parser } as const;
|
17
|
-
}
|
18
|
-
}
|
1
|
+
import Option from "../index.js";
|
2
|
+
|
3
|
+
export default class Jsonc extends Option<
|
4
|
+
"jsonc",
|
5
|
+
"jsonc",
|
6
|
+
false,
|
7
|
+
true,
|
8
|
+
1
|
9
|
+
> {
|
10
|
+
public readonly scope = "jsonc";
|
11
|
+
public readonly processor = {} as const;
|
12
|
+
|
13
|
+
public get languageOptions() {
|
14
|
+
const [parser] = this.parser;
|
15
|
+
|
16
|
+
return { parser } as const;
|
17
|
+
}
|
18
|
+
}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import Option from "../index.js";
|
2
|
-
|
3
|
-
export default class Md extends Option<
|
4
|
-
"md",
|
5
|
-
"markdownlint",
|
6
|
-
false,
|
7
|
-
true,
|
8
|
-
1
|
9
|
-
> {
|
10
|
-
public readonly scope = "md";
|
11
|
-
public readonly processor = {} as const;
|
12
|
-
|
13
|
-
public get languageOptions() {
|
14
|
-
const [parser] = this.parser;
|
15
|
-
|
16
|
-
return { parser } as const;
|
17
|
-
}
|
18
|
-
}
|
1
|
+
import Option from "../index.js";
|
2
|
+
|
3
|
+
export default class Md extends Option<
|
4
|
+
"md",
|
5
|
+
"markdownlint",
|
6
|
+
false,
|
7
|
+
true,
|
8
|
+
1
|
9
|
+
> {
|
10
|
+
public readonly scope = "md";
|
11
|
+
public readonly processor = {} as const;
|
12
|
+
|
13
|
+
public get languageOptions() {
|
14
|
+
const [parser] = this.parser;
|
15
|
+
|
16
|
+
return { parser } as const;
|
17
|
+
}
|
18
|
+
}
|
@@ -1,28 +1,28 @@
|
|
1
|
-
import Option from "../index.js";
|
2
|
-
import type Ts from "../ts/index.js";
|
3
|
-
|
4
|
-
export default class Mocha extends Option<
|
5
|
-
"mocha",
|
6
|
-
"mocha" | keyof Ts["option"]["plugins"],
|
7
|
-
true,
|
8
|
-
Ts["option"]["languageOptions"]["parserOptions"],
|
9
|
-
1,
|
10
|
-
"mocha"
|
11
|
-
> {
|
12
|
-
public readonly scope = "mocha";
|
13
|
-
public readonly processor = {} as const;
|
14
|
-
public readonly types = ["mocha"] as const;
|
15
|
-
|
16
|
-
public get languageOptions() {
|
17
|
-
const [parser] = this.parser,
|
18
|
-
globals = this.globals("mocha");
|
19
|
-
|
20
|
-
return {
|
21
|
-
ecmaVersion: "latest",
|
22
|
-
sourceType: "module",
|
23
|
-
parser,
|
24
|
-
parserOptions: { project: "tsconfig.json", ecmaVersion: "latest", sourceType: "module" },
|
25
|
-
globals,
|
26
|
-
} as const;
|
27
|
-
}
|
28
|
-
}
|
1
|
+
import Option from "../index.js";
|
2
|
+
import type Ts from "../ts/index.js";
|
3
|
+
|
4
|
+
export default class Mocha extends Option<
|
5
|
+
"mocha",
|
6
|
+
"mocha" | keyof Ts["option"]["plugins"],
|
7
|
+
true,
|
8
|
+
Ts["option"]["languageOptions"]["parserOptions"],
|
9
|
+
1,
|
10
|
+
"mocha"
|
11
|
+
> {
|
12
|
+
public readonly scope = "mocha";
|
13
|
+
public readonly processor = {} as const;
|
14
|
+
public readonly types = ["mocha"] as const;
|
15
|
+
|
16
|
+
public get languageOptions() {
|
17
|
+
const [parser] = this.parser,
|
18
|
+
globals = this.globals("mocha");
|
19
|
+
|
20
|
+
return {
|
21
|
+
ecmaVersion: "latest",
|
22
|
+
sourceType: "module",
|
23
|
+
parser,
|
24
|
+
parserOptions: { project: "tsconfig.json", ecmaVersion: "latest", sourceType: "module" },
|
25
|
+
globals,
|
26
|
+
} as const;
|
27
|
+
}
|
28
|
+
}
|