@eslinted/core 4.0.3 → 4.0.5-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/RELEASE.yml +1 -0
- package/.github/workflows/rc.yml +1 -0
- package/package.json +19 -5
- package/src/factory/{files/index.ts → files.ts} +4 -4
- package/src/factory/index.ts +3 -6
- package/src/factory/options/{option/html/index.ts → html.ts} +1 -1
- package/src/factory/options/index.ts +9 -9
- package/src/factory/options/{option/js/index.ts → js.ts} +1 -1
- package/src/factory/options/{option/json/index.ts → json.ts} +1 -1
- package/src/factory/options/{option/jsonc/index.ts → jsonc.ts} +1 -1
- package/src/factory/options/{option/md/index.ts → md.ts} +1 -1
- package/src/factory/options/{option/mocha/index.ts → mocha.ts} +2 -2
- package/src/factory/options/option/index.ts +19 -13
- package/src/factory/options/option/params/globals.ts +3 -0
- package/src/{boundary/output/config/option/language/index.ts → factory/options/option/params/language.ts} +3 -5
- package/src/factory/options/option/params/languageOptions/ecma.ts +1 -0
- package/src/factory/options/option/params/languageOptions/source.ts +1 -0
- package/src/{boundary/output/config/option/linter/index.ts → factory/options/option/params/linter.ts} +1 -1
- package/src/factory/options/option/params/plugins.ts +1 -0
- package/src/factory/options/option/template.ts +24 -0
- package/src/factory/options/{option/svelte/index.ts → svelte.ts} +2 -2
- package/src/factory/options/{option/ts/index.ts → ts.ts} +2 -2
- package/src/factory/options/{option/yml/index.ts → yml.ts} +1 -1
- package/src/factory/{rulesets/ruleset → ruleset}/index.ts +5 -4
- package/src/factory/ruleset/rule.ts +8 -0
- package/src/factory/{rulesets/index.ts → rulesets.ts} +5 -5
- package/src/index.ts +20 -19
- package/src/input.ts +11 -0
- package/src/inputs/files/base.ts +3 -0
- package/src/inputs/files/includes.ts +3 -0
- package/src/inputs/files.ts +7 -0
- package/src/inputs/imports/parsers.ts +11 -0
- package/src/{dependency/plugins/index.ts → inputs/imports/plugins.ts} +2 -5
- package/src/inputs/imports.ts +2 -0
- package/src/inputs/parsers.ts +3 -0
- package/src/inputs/plugins.ts +3 -0
- package/src/inputs/rules/entry/index.ts +3 -0
- package/src/inputs/rules/entry/object/index.ts +7 -0
- package/src/inputs/rules/entry/object/state/index.ts +4 -0
- package/src/inputs/rules/overrides.ts +4 -0
- package/src/inputs/rules/preset.ts +4 -0
- package/src/inputs/rules.ts +7 -0
- package/src/{boundary/output/config/index.ts → output.ts} +3 -4
- package/src/{scopes/index.ts → scopes.ts} +1 -3
- package/dist/boundary/index.d.ts +0 -9
- package/dist/boundary/index.d.ts.map +0 -1
- package/dist/boundary/index.js +0 -2
- package/dist/boundary/index.js.map +0 -1
- package/dist/boundary/input/files/default/index.d.ts +0 -4
- package/dist/boundary/input/files/default/index.d.ts.map +0 -1
- package/dist/boundary/input/files/default/index.js +0 -2
- package/dist/boundary/input/files/default/index.js.map +0 -1
- package/dist/boundary/input/files/includes/index.d.ts +0 -4
- package/dist/boundary/input/files/includes/index.d.ts.map +0 -1
- package/dist/boundary/input/files/includes/index.js +0 -2
- package/dist/boundary/input/files/includes/index.js.map +0 -1
- package/dist/boundary/input/files/index.d.ts +0 -8
- package/dist/boundary/input/files/index.d.ts.map +0 -1
- package/dist/boundary/input/files/index.js +0 -2
- package/dist/boundary/input/files/index.js.map +0 -1
- package/dist/boundary/input/index.d.ts +0 -14
- package/dist/boundary/input/index.d.ts.map +0 -1
- package/dist/boundary/input/index.js +0 -2
- package/dist/boundary/input/index.js.map +0 -1
- package/dist/boundary/input/parsers/index.d.ts +0 -4
- package/dist/boundary/input/parsers/index.d.ts.map +0 -1
- package/dist/boundary/input/parsers/index.js +0 -2
- package/dist/boundary/input/parsers/index.js.map +0 -1
- package/dist/boundary/input/plugins/index.d.ts +0 -6
- package/dist/boundary/input/plugins/index.d.ts.map +0 -1
- package/dist/boundary/input/plugins/index.js +0 -2
- package/dist/boundary/input/plugins/index.js.map +0 -1
- package/dist/boundary/input/rules/index.d.ts +0 -8
- package/dist/boundary/input/rules/index.d.ts.map +0 -1
- package/dist/boundary/input/rules/index.js +0 -2
- package/dist/boundary/input/rules/index.js.map +0 -1
- package/dist/boundary/input/rules/overrides/index.d.ts +0 -5
- package/dist/boundary/input/rules/overrides/index.d.ts.map +0 -1
- package/dist/boundary/input/rules/overrides/index.js +0 -2
- package/dist/boundary/input/rules/overrides/index.js.map +0 -1
- package/dist/boundary/input/rules/preset/entry/index.d.ts +0 -4
- package/dist/boundary/input/rules/preset/entry/index.d.ts.map +0 -1
- package/dist/boundary/input/rules/preset/entry/index.js +0 -2
- package/dist/boundary/input/rules/preset/entry/index.js.map +0 -1
- package/dist/boundary/input/rules/preset/entry/object/index.d.ts +0 -4
- package/dist/boundary/input/rules/preset/entry/object/index.d.ts.map +0 -1
- package/dist/boundary/input/rules/preset/entry/object/index.js +0 -2
- package/dist/boundary/input/rules/preset/entry/object/index.js.map +0 -1
- package/dist/boundary/input/rules/preset/entry/object/state/index.d.ts +0 -3
- package/dist/boundary/input/rules/preset/entry/object/state/index.d.ts.map +0 -1
- package/dist/boundary/input/rules/preset/entry/object/state/index.js +0 -2
- package/dist/boundary/input/rules/preset/entry/object/state/index.js.map +0 -1
- package/dist/boundary/input/rules/preset/index.d.ts +0 -5
- package/dist/boundary/input/rules/preset/index.d.ts.map +0 -1
- package/dist/boundary/input/rules/preset/index.js +0 -2
- package/dist/boundary/input/rules/preset/index.js.map +0 -1
- package/dist/boundary/output/config/index.d.ts +0 -22
- package/dist/boundary/output/config/index.d.ts.map +0 -1
- package/dist/boundary/output/config/index.js +0 -2
- package/dist/boundary/output/config/index.js.map +0 -1
- package/dist/boundary/output/config/option/index.d.ts +0 -14
- package/dist/boundary/output/config/option/index.d.ts.map +0 -1
- package/dist/boundary/output/config/option/index.js +0 -2
- package/dist/boundary/output/config/option/index.js.map +0 -1
- package/dist/boundary/output/config/option/language/ecma/index.d.ts +0 -3
- package/dist/boundary/output/config/option/language/ecma/index.d.ts.map +0 -1
- package/dist/boundary/output/config/option/language/ecma/index.js +0 -2
- package/dist/boundary/output/config/option/language/ecma/index.js.map +0 -1
- package/dist/boundary/output/config/option/language/index.d.ts +0 -15
- package/dist/boundary/output/config/option/language/index.d.ts.map +0 -1
- package/dist/boundary/output/config/option/language/index.js +0 -2
- package/dist/boundary/output/config/option/language/index.js.map +0 -1
- package/dist/boundary/output/config/option/language/source/index.d.ts +0 -3
- package/dist/boundary/output/config/option/language/source/index.d.ts.map +0 -1
- package/dist/boundary/output/config/option/language/source/index.js +0 -2
- package/dist/boundary/output/config/option/language/source/index.js.map +0 -1
- package/dist/boundary/output/config/option/linter/index.d.ts +0 -5
- package/dist/boundary/output/config/option/linter/index.d.ts.map +0 -1
- package/dist/boundary/output/config/option/linter/index.js +0 -2
- package/dist/boundary/output/config/option/linter/index.js.map +0 -1
- package/dist/boundary/output/config/option/plugins/index.d.ts +0 -5
- package/dist/boundary/output/config/option/plugins/index.d.ts.map +0 -1
- package/dist/boundary/output/config/option/plugins/index.js +0 -2
- package/dist/boundary/output/config/option/plugins/index.js.map +0 -1
- package/dist/boundary/output/index.d.ts +0 -3
- package/dist/boundary/output/index.d.ts.map +0 -1
- package/dist/boundary/output/index.js +0 -2
- package/dist/boundary/output/index.js.map +0 -1
- package/dist/dependency/globals/index.d.ts +0 -4
- package/dist/dependency/globals/index.d.ts.map +0 -1
- package/dist/dependency/globals/index.js +0 -2
- package/dist/dependency/globals/index.js.map +0 -1
- package/dist/dependency/index.d.ts +0 -5
- package/dist/dependency/index.d.ts.map +0 -1
- package/dist/dependency/index.js +0 -2
- package/dist/dependency/index.js.map +0 -1
- package/dist/dependency/parsers/index.d.ts +0 -4
- package/dist/dependency/parsers/index.d.ts.map +0 -1
- package/dist/dependency/parsers/index.js +0 -2
- package/dist/dependency/parsers/index.js.map +0 -1
- package/dist/dependency/plugins/index.d.ts +0 -3
- package/dist/dependency/plugins/index.d.ts.map +0 -1
- package/dist/dependency/plugins/index.js +0 -2
- package/dist/dependency/plugins/index.js.map +0 -1
- package/dist/factory/files/index.d.ts +0 -8
- package/dist/factory/files/index.d.ts.map +0 -1
- package/dist/factory/files/index.js +0 -16
- package/dist/factory/files/index.js.map +0 -1
- package/dist/factory/index.d.ts +0 -7
- package/dist/factory/index.d.ts.map +0 -1
- package/dist/factory/index.js +0 -7
- package/dist/factory/index.js.map +0 -1
- package/dist/factory/options/index.d.ts +0 -22
- package/dist/factory/options/index.d.ts.map +0 -1
- package/dist/factory/options/index.js +0 -21
- package/dist/factory/options/index.js.map +0 -1
- package/dist/factory/options/option/html/index.d.ts +0 -9
- package/dist/factory/options/option/html/index.d.ts.map +0 -1
- package/dist/factory/options/option/html/index.js +0 -10
- package/dist/factory/options/option/html/index.js.map +0 -1
- package/dist/factory/options/option/index.d.ts +0 -2989
- package/dist/factory/options/option/index.d.ts.map +0 -1
- package/dist/factory/options/option/index.js +0 -56
- package/dist/factory/options/option/index.js.map +0 -1
- package/dist/factory/options/option/js/index.d.ts +0 -10
- package/dist/factory/options/option/js/index.d.ts.map +0 -1
- package/dist/factory/options/option/js/index.js +0 -12
- package/dist/factory/options/option/js/index.js.map +0 -1
- package/dist/factory/options/option/json/index.d.ts +0 -9
- package/dist/factory/options/option/json/index.d.ts.map +0 -1
- package/dist/factory/options/option/json/index.js +0 -10
- package/dist/factory/options/option/json/index.js.map +0 -1
- package/dist/factory/options/option/jsonc/index.d.ts +0 -9
- package/dist/factory/options/option/jsonc/index.d.ts.map +0 -1
- package/dist/factory/options/option/jsonc/index.js +0 -10
- package/dist/factory/options/option/jsonc/index.js.map +0 -1
- package/dist/factory/options/option/md/index.d.ts +0 -9
- package/dist/factory/options/option/md/index.d.ts.map +0 -1
- package/dist/factory/options/option/md/index.js +0 -10
- package/dist/factory/options/option/md/index.js.map +0 -1
- package/dist/factory/options/option/mocha/index.d.ts +0 -40
- package/dist/factory/options/option/mocha/index.d.ts.map +0 -1
- package/dist/factory/options/option/mocha/index.js +0 -17
- package/dist/factory/options/option/mocha/index.js.map +0 -1
- package/dist/factory/options/option/svelte/index.d.ts +0 -27
- package/dist/factory/options/option/svelte/index.d.ts.map +0 -1
- package/dist/factory/options/option/svelte/index.js +0 -21
- package/dist/factory/options/option/svelte/index.js.map +0 -1
- package/dist/factory/options/option/ts/index.d.ts +0 -19
- package/dist/factory/options/option/ts/index.d.ts.map +0 -1
- package/dist/factory/options/option/ts/index.js +0 -15
- package/dist/factory/options/option/ts/index.js.map +0 -1
- package/dist/factory/options/option/yml/index.d.ts +0 -9
- package/dist/factory/options/option/yml/index.d.ts.map +0 -1
- package/dist/factory/options/option/yml/index.js +0 -10
- package/dist/factory/options/option/yml/index.js.map +0 -1
- package/dist/factory/rulesets/index.d.ts +0 -9
- package/dist/factory/rulesets/index.d.ts.map +0 -1
- package/dist/factory/rulesets/index.js +0 -17
- package/dist/factory/rulesets/index.js.map +0 -1
- package/dist/factory/rulesets/ruleset/index.d.ts +0 -13
- package/dist/factory/rulesets/ruleset/index.d.ts.map +0 -1
- package/dist/factory/rulesets/ruleset/index.js +0 -38
- package/dist/factory/rulesets/ruleset/index.js.map +0 -1
- package/dist/factory/rulesets/ruleset/rule/index.d.ts +0 -7
- package/dist/factory/rulesets/ruleset/rule/index.d.ts.map +0 -1
- package/dist/factory/rulesets/ruleset/rule/index.js +0 -9
- package/dist/factory/rulesets/ruleset/rule/index.js.map +0 -1
- package/dist/index.d.ts +0 -23
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -31
- package/dist/index.js.map +0 -1
- package/dist/scopes/index.d.ts +0 -4
- package/dist/scopes/index.d.ts.map +0 -1
- package/dist/scopes/index.js +0 -13
- package/dist/scopes/index.js.map +0 -1
- package/src/boundary/index.ts +0 -15
- package/src/boundary/input/files/default/index.ts +0 -8
- package/src/boundary/input/files/includes/index.ts +0 -5
- package/src/boundary/input/files/index.ts +0 -11
- package/src/boundary/input/index.ts +0 -23
- package/src/boundary/input/parsers/index.ts +0 -5
- package/src/boundary/input/plugins/index.ts +0 -5
- package/src/boundary/input/rules/index.ts +0 -14
- package/src/boundary/input/rules/overrides/index.ts +0 -6
- package/src/boundary/input/rules/preset/entry/index.ts +0 -9
- package/src/boundary/input/rules/preset/entry/object/index.ts +0 -13
- package/src/boundary/input/rules/preset/entry/object/state/index.ts +0 -10
- package/src/boundary/input/rules/preset/index.ts +0 -10
- package/src/boundary/output/config/option/index.ts +0 -24
- package/src/boundary/output/config/option/language/ecma/index.ts +0 -3
- package/src/boundary/output/config/option/language/source/index.ts +0 -3
- package/src/boundary/output/config/option/plugins/index.ts +0 -3
- package/src/boundary/output/index.ts +0 -3
- package/src/dependency/globals/index.ts +0 -8
- package/src/dependency/index.ts +0 -5
- package/src/dependency/parsers/index.ts +0 -13
- package/src/factory/rulesets/ruleset/rule/index.ts +0 -8
package/.github/workflows/rc.yml
CHANGED
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"_schemaVersion": "20.
|
2
|
+
"_schemaVersion": "20.18.0-core.0",
|
3
3
|
"name": "@eslinted/core",
|
4
|
-
"version": "4.0.
|
4
|
+
"version": "4.0.5-rc.0",
|
5
5
|
"description": "Core ESLint flat config factory npm package `linted`.",
|
6
6
|
"keywords": [],
|
7
7
|
"repository": "github:jimmy-zhening-luo/linted-core",
|
@@ -13,8 +13,22 @@
|
|
13
13
|
"access": "public"
|
14
14
|
},
|
15
15
|
"type": "module",
|
16
|
-
"
|
17
|
-
|
16
|
+
"exports": {
|
17
|
+
".": {
|
18
|
+
"types": "./dist/index.d.ts",
|
19
|
+
"default": "./dist/index.js"
|
20
|
+
},
|
21
|
+
"./input": {
|
22
|
+
"types": "./dist/input.d.ts"
|
23
|
+
},
|
24
|
+
"./scopes": {
|
25
|
+
"types": "./dist/scopes.d.ts",
|
26
|
+
"default": "./dist/scopes.js"
|
27
|
+
},
|
28
|
+
"./output": {
|
29
|
+
"types": "./dist/output.d.ts"
|
30
|
+
}
|
31
|
+
},
|
18
32
|
"config": {
|
19
33
|
"language": "ts",
|
20
34
|
"fix": "true",
|
@@ -22,7 +36,7 @@
|
|
22
36
|
},
|
23
37
|
"engineStrict": true,
|
24
38
|
"engines": {
|
25
|
-
"node": ">=20.
|
39
|
+
"node": ">=20.18.0",
|
26
40
|
"npm": ">=10.8.2"
|
27
41
|
},
|
28
42
|
"peerDependenciesMeta": {},
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import type { Scope } from "
|
2
|
-
import type { Input } from "
|
1
|
+
import type { Scope } from "@eslinted/core/scopes";
|
2
|
+
import type { Input } from "@eslinted/core/input";
|
3
3
|
|
4
|
-
export
|
5
|
-
constructor(private readonly input: Input
|
4
|
+
export class Files {
|
5
|
+
constructor(private readonly input: Input["files"]) {}
|
6
6
|
|
7
7
|
public files(scope: Scope): readonly string[] {
|
8
8
|
try {
|
package/src/factory/index.ts
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
import Rulesets from "./rulesets
|
2
|
-
import Files from "./files
|
3
|
-
import Options from "./options
|
1
|
+
import { Rulesets } from "./rulesets";
|
2
|
+
import { Files } from "./files";
|
3
|
+
import Options from "./options";
|
4
4
|
|
5
|
-
export class Factory {
|
6
|
-
|
7
|
-
}
|
8
5
|
export { Options, Files, Rulesets };
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import js from "./
|
2
|
-
import ts from "./
|
3
|
-
import svelte from "./
|
4
|
-
import mocha from "./
|
5
|
-
import html from "./
|
6
|
-
import json from "./
|
7
|
-
import jsonc from "./
|
8
|
-
import yml from "./
|
9
|
-
import md from "./
|
1
|
+
import js from "./js";
|
2
|
+
import ts from "./ts";
|
3
|
+
import svelte from "./svelte";
|
4
|
+
import mocha from "./mocha";
|
5
|
+
import html from "./html";
|
6
|
+
import json from "./json";
|
7
|
+
import jsonc from "./jsonc";
|
8
|
+
import yml from "./yml";
|
9
|
+
import md from "./md";
|
10
10
|
|
11
11
|
export default {
|
12
12
|
js,
|
@@ -1,16 +1,22 @@
|
|
1
|
+
import type { Input } from "@eslinted/core/input";
|
2
|
+
import type { Scope } from "@eslinted/core/scopes";
|
3
|
+
import type { Output } from "@eslinted/core/output";
|
4
|
+
import type { Ruleset } from "../../ruleset";
|
5
|
+
import type {
|
6
|
+
OptionTemplate,
|
7
|
+
LanguageOptions,
|
8
|
+
Plugins,
|
9
|
+
Globals,
|
10
|
+
} from "./template";
|
1
11
|
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
12
|
|
7
13
|
export default abstract class Option<
|
8
14
|
S extends Scope,
|
9
|
-
|
15
|
+
Plugin extends keyof Input["plugins"],
|
10
16
|
IsEcma extends boolean = true,
|
11
17
|
ParserOptions extends object | boolean = false,
|
12
18
|
ParserCount extends 0 | 1 | 2 = 0,
|
13
|
-
|
19
|
+
Global extends Globals = never,
|
14
20
|
Processor extends object = never,
|
15
21
|
> {
|
16
22
|
private readonly linterOptions = { noInlineConfig: true, reportUnusedDisableDirectives: "error" } as const;
|
@@ -25,11 +31,11 @@ export default abstract class Option<
|
|
25
31
|
constructor(
|
26
32
|
public readonly files: readonly string[],
|
27
33
|
public readonly ruleset: Ruleset<S>,
|
28
|
-
public readonly plugins:
|
34
|
+
public readonly plugins: Plugins<Plugin>,
|
29
35
|
public readonly parser: Tuple<unknown, ParserCount>,
|
30
36
|
) {}
|
31
37
|
|
32
|
-
public get configs(): Output
|
38
|
+
public get configs(): Output {
|
33
39
|
try {
|
34
40
|
const {
|
35
41
|
scope,
|
@@ -74,20 +80,20 @@ export default abstract class Option<
|
|
74
80
|
linterOptions,
|
75
81
|
languageOptions,
|
76
82
|
...processor,
|
77
|
-
} satisfies
|
78
|
-
|
83
|
+
} satisfies OptionTemplate<
|
84
|
+
Plugin,
|
79
85
|
IsEcma,
|
80
86
|
ParserOptions,
|
81
|
-
|
87
|
+
Global,
|
82
88
|
Processor
|
83
89
|
>;
|
84
90
|
}
|
85
91
|
catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e }); }
|
86
92
|
}
|
87
93
|
|
88
|
-
protected abstract get languageOptions():
|
94
|
+
protected abstract get languageOptions(): LanguageOptions<IsEcma, ParserOptions, Global>;
|
89
95
|
|
90
|
-
protected globals(type:
|
96
|
+
protected globals(type: Global) {
|
91
97
|
return globals[type];
|
92
98
|
}
|
93
99
|
}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import type Ecma from "./ecma
|
2
|
-
import type Source from "./source
|
1
|
+
import type { Ecma } from "./languageOptions/ecma";
|
2
|
+
import type { Source } from "./languageOptions/source";
|
3
3
|
|
4
|
-
type
|
4
|
+
export type LanguageOptions<
|
5
5
|
IsEcma extends boolean,
|
6
6
|
ParserOptions extends object | boolean,
|
7
7
|
GlobalTypes extends string,
|
@@ -19,5 +19,3 @@ type Language<
|
|
19
19
|
: { parser: unknown; parserOptions: ParserOptions }
|
20
20
|
: object
|
21
21
|
);
|
22
|
-
|
23
|
-
export type { Language, Language as default };
|
@@ -0,0 +1 @@
|
|
1
|
+
export type Ecma = "latest";
|
@@ -0,0 +1 @@
|
|
1
|
+
export type Source = "module" | "script";
|
@@ -0,0 +1 @@
|
|
1
|
+
export type Plugins<PluginId extends string> = Record<literalful<PluginId>, { configs: unknown }>;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import type { LanguageOptions } from "./params/language";
|
2
|
+
import type { Linter } from "./params/linter";
|
3
|
+
import type { Plugins } from "./params/plugins";
|
4
|
+
import type { Globals } from "./params/globals";
|
5
|
+
|
6
|
+
export type {
|
7
|
+
LanguageOptions,
|
8
|
+
Linter,
|
9
|
+
Plugins,
|
10
|
+
Globals,
|
11
|
+
};
|
12
|
+
export type OptionTemplate<
|
13
|
+
PluginId extends string,
|
14
|
+
IsEcma extends boolean,
|
15
|
+
ParserOptions extends boolean | object,
|
16
|
+
GlobalTypes extends Globals,
|
17
|
+
Processor extends object,
|
18
|
+
> =
|
19
|
+
& {
|
20
|
+
linterOptions: Linter;
|
21
|
+
languageOptions: LanguageOptions<IsEcma, ParserOptions, GlobalTypes>;
|
22
|
+
}
|
23
|
+
& (Plugins<PluginId> extends never ? object : { plugins: Plugins<PluginId> })
|
24
|
+
& (Interface<Processor> extends never ? object : Interface<Processor> extends { processor: string } ? Interface<Processor> : object);
|
@@ -1,8 +1,9 @@
|
|
1
|
-
import type {
|
2
|
-
import
|
1
|
+
import type { Input } from "@eslinted/core/input";
|
2
|
+
import type { Scope } from "@eslinted/core/scopes";
|
3
|
+
import { Rule } from "./rule";
|
3
4
|
|
4
5
|
export { Rule };
|
5
|
-
export
|
6
|
+
export class Ruleset<S extends Scope> {
|
6
7
|
public readonly ruleset: readonly Rule[];
|
7
8
|
public overrides: Null<Rule> = null;
|
8
9
|
|
@@ -31,7 +32,7 @@ export default class Ruleset<S extends Scope> {
|
|
31
32
|
catch (e) { throw new Error(`linted.factory.Ruleset: records`, { cause: e }); }
|
32
33
|
}
|
33
34
|
|
34
|
-
public override(overrides: undefined |
|
35
|
+
public override(overrides: undefined | Input["rules"]["rules"][Scope][number][1]) {
|
35
36
|
if (typeof overrides !== "undefined")
|
36
37
|
this.overrides = new Rule("override", overrides);
|
37
38
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import
|
2
|
-
import type {
|
3
|
-
import
|
1
|
+
import type { Input } from "@eslinted/core/input";
|
2
|
+
import type { Scope } from "@eslinted/core/scopes";
|
3
|
+
import { Ruleset, Rule } from "./ruleset";
|
4
4
|
|
5
|
-
export
|
6
|
-
constructor(private readonly input: Input
|
5
|
+
export class Rulesets {
|
6
|
+
constructor(private readonly input: Input["rules"]) {}
|
7
7
|
|
8
8
|
public ruleset<S extends Scope>(scope: literalful<S>): Ruleset<S> {
|
9
9
|
try {
|
package/src/index.ts
CHANGED
@@ -1,18 +1,19 @@
|
|
1
|
+
import type { Input } from "./input";
|
2
|
+
import type { Scope } from "./scopes";
|
3
|
+
import type { Output } from "./output";
|
4
|
+
import { scopes } from "./scopes";
|
1
5
|
import {
|
2
|
-
Options,
|
3
6
|
Files,
|
4
7
|
Rulesets,
|
5
|
-
|
6
|
-
|
7
|
-
import type { Scope } from "./scopes/index.js";
|
8
|
-
import type * as core from "./boundary/index.js";
|
8
|
+
Options,
|
9
|
+
} from "./factory";
|
9
10
|
|
10
11
|
export default function (
|
11
|
-
plugins:
|
12
|
-
parsers:
|
13
|
-
files:
|
14
|
-
rules:
|
15
|
-
):
|
12
|
+
plugins: Input["plugins"],
|
13
|
+
parsers: Input["parsers"],
|
14
|
+
files: Input["files"],
|
15
|
+
rules: Input["rules"],
|
16
|
+
): Output {
|
16
17
|
try {
|
17
18
|
const F = new Files(files),
|
18
19
|
R = new Rulesets(rules),
|
@@ -90,20 +91,20 @@ export default function (
|
|
90
91
|
namespace Core {
|
91
92
|
export type Scopes = Scope;
|
92
93
|
export namespace Input {
|
93
|
-
export type Parsers =
|
94
|
-
export type Plugins =
|
95
|
-
export type Files =
|
94
|
+
export type Parsers = Input["parsers"];
|
95
|
+
export type Plugins = Input["plugins"];
|
96
|
+
export type Files = Input["files"];
|
96
97
|
export namespace Files {
|
97
|
-
export type Base =
|
98
|
-
export type Includes =
|
98
|
+
export type Base = Files["files"];
|
99
|
+
export type Includes = Files["includes"];
|
99
100
|
}
|
100
|
-
export type Rules =
|
101
|
+
export type Rules = Input["rules"];
|
101
102
|
export namespace Rules {
|
102
|
-
export type Base =
|
103
|
-
export type Overrides =
|
103
|
+
export type Base = Rules["rules"];
|
104
|
+
export type Overrides = Rules["overrides"];
|
104
105
|
}
|
105
106
|
}
|
106
|
-
export type Output =
|
107
|
+
export type Output = Output[];
|
107
108
|
}
|
108
109
|
|
109
110
|
export type { Core };
|
package/src/input.ts
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Plugins } from "./inputs/plugins";
|
2
|
+
import type { Parsers } from "./inputs/parsers";
|
3
|
+
import type { Files } from "./inputs/files";
|
4
|
+
import type { Rules } from "./inputs/rules";
|
5
|
+
|
6
|
+
export interface Input {
|
7
|
+
files: Files;
|
8
|
+
rules: Rules;
|
9
|
+
plugins: Plugins;
|
10
|
+
parsers: Parsers;
|
11
|
+
}
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import type {
|
2
|
-
import type * as Config from "./option/index.js";
|
1
|
+
import type { Input } from "./input";
|
3
2
|
|
4
3
|
interface Config {
|
5
4
|
name: `linted/scope:${string}/rule:${string}+${string}`;
|
6
|
-
rules:
|
5
|
+
rules: Input["rules"]["rules"]["html"][number][1];
|
7
6
|
files: readonly string[];
|
8
7
|
linterOptions: {
|
9
8
|
noInlineConfig: true;
|
@@ -22,4 +21,4 @@ interface Config {
|
|
22
21
|
processor?: string;
|
23
22
|
}
|
24
23
|
|
25
|
-
export type
|
24
|
+
export type Output = Config[];
|
package/dist/boundary/index.d.ts
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
import type * as Input from "./input/index.js";
|
2
|
-
import type * as Output from "./output/index.js";
|
3
|
-
type Output = Output.Config;
|
4
|
-
declare namespace Boundary {
|
5
|
-
type Input = Input.Input;
|
6
|
-
type Output = Output.Config;
|
7
|
-
}
|
8
|
-
export type { Input, Output, Boundary as default, };
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/boundary/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAEjD,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAE5B,kBAAU,QAAQ,CAAC;IACjB,KAAY,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAChC,KAAY,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;CACpC;AAED,YAAY,EACV,KAAK,EACL,MAAM,EACN,QAAQ,IAAI,OAAO,GACpB,CAAC"}
|
package/dist/boundary/index.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/boundary/index.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/boundary/input/files/default/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,KAAK,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;AAE3D,YAAY,EACV,QAAQ,EACR,QAAQ,IAAI,OAAO,GACpB,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/boundary/input/files/default/index.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/boundary/input/files/includes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAErD,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAE3C,YAAY,EAAE,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/boundary/input/files/includes/index.ts"],"names":[],"mappings":""}
|