@eslinted/core 4.0.5-rc.5 → 4.0.5-rc.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/factory/files.d.ts +8 -0
- package/dist/factory/files.d.ts.map +1 -0
- package/dist/factory/files.js +19 -0
- package/dist/factory/files.js.map +1 -0
- package/dist/factory/index.d.ts +6 -0
- package/dist/factory/index.d.ts.map +1 -0
- package/dist/factory/index.js +5 -0
- package/dist/factory/index.js.map +1 -0
- package/dist/factory/options/html.d.ts +9 -0
- package/dist/factory/options/html.d.ts.map +1 -0
- package/dist/factory/options/html.js +10 -0
- package/dist/factory/options/html.js.map +1 -0
- package/dist/factory/options/index.d.ts +23 -0
- package/dist/factory/options/index.d.ts.map +1 -0
- package/dist/factory/options/index.js +21 -0
- package/dist/factory/options/index.js.map +1 -0
- package/dist/factory/options/js.d.ts +10 -0
- package/dist/factory/options/js.d.ts.map +1 -0
- package/dist/factory/options/js.js +12 -0
- package/dist/factory/options/js.js.map +1 -0
- package/dist/factory/options/json.d.ts +9 -0
- package/dist/factory/options/json.d.ts.map +1 -0
- package/dist/factory/options/json.js +10 -0
- package/dist/factory/options/json.js.map +1 -0
- package/dist/factory/options/jsonc.d.ts +9 -0
- package/dist/factory/options/jsonc.d.ts.map +1 -0
- package/dist/factory/options/jsonc.js +10 -0
- package/dist/factory/options/jsonc.js.map +1 -0
- package/dist/factory/options/md.d.ts +9 -0
- package/dist/factory/options/md.d.ts.map +1 -0
- package/dist/factory/options/md.js +10 -0
- package/dist/factory/options/md.js.map +1 -0
- package/dist/factory/options/mocha.d.ts +40 -0
- package/dist/factory/options/mocha.d.ts.map +1 -0
- package/dist/factory/options/mocha.js +17 -0
- package/dist/factory/options/mocha.js.map +1 -0
- package/dist/factory/options/option/index.d.ts +2986 -0
- package/dist/factory/options/option/index.d.ts.map +1 -0
- package/dist/factory/options/option/index.js +47 -0
- package/dist/factory/options/option/index.js.map +1 -0
- package/dist/factory/options/option/template/globals.d.ts +3 -0
- package/dist/factory/options/option/template/globals.d.ts.map +1 -0
- package/dist/factory/options/option/template/globals.js +1 -0
- package/dist/factory/options/option/template/globals.js.map +1 -0
- package/dist/factory/options/option/template/index.d.ts +15 -0
- package/dist/factory/options/option/template/index.d.ts.map +1 -0
- package/dist/factory/options/option/template/index.js +1 -0
- package/dist/factory/options/option/template/index.js.map +1 -0
- package/dist/factory/options/option/template/language/ecma.d.ts +2 -0
- package/dist/factory/options/option/template/language/ecma.d.ts.map +1 -0
- package/dist/factory/options/option/template/language/ecma.js +1 -0
- package/dist/factory/options/option/template/language/ecma.js.map +1 -0
- package/dist/factory/options/option/template/language/index.d.ts +14 -0
- package/dist/factory/options/option/template/language/index.d.ts.map +1 -0
- package/dist/factory/options/option/template/language/index.js +1 -0
- package/dist/factory/options/option/template/language/index.js.map +1 -0
- package/dist/factory/options/option/template/language/source.d.ts +2 -0
- package/dist/factory/options/option/template/language/source.d.ts.map +1 -0
- package/dist/factory/options/option/template/language/source.js +1 -0
- package/dist/factory/options/option/template/language/source.js.map +1 -0
- package/dist/factory/options/option/template/linter.d.ts +5 -0
- package/dist/factory/options/option/template/linter.d.ts.map +1 -0
- package/dist/factory/options/option/template/linter.js +1 -0
- package/dist/factory/options/option/template/linter.js.map +1 -0
- package/dist/factory/options/option/template/plugins.d.ts +6 -0
- package/dist/factory/options/option/template/plugins.d.ts.map +1 -0
- package/dist/factory/options/option/template/plugins.js +1 -0
- package/dist/factory/options/option/template/plugins.js.map +1 -0
- package/dist/factory/options/svelte.d.ts +27 -0
- package/dist/factory/options/svelte.d.ts.map +1 -0
- package/dist/factory/options/svelte.js +21 -0
- package/dist/factory/options/svelte.js.map +1 -0
- package/dist/factory/options/ts.d.ts +19 -0
- package/dist/factory/options/ts.d.ts.map +1 -0
- package/dist/factory/options/ts.js +15 -0
- package/dist/factory/options/ts.js.map +1 -0
- package/dist/factory/options/yml.d.ts +9 -0
- package/dist/factory/options/yml.d.ts.map +1 -0
- package/dist/factory/options/yml.js +10 -0
- package/dist/factory/options/yml.js.map +1 -0
- package/dist/factory/rulesets/index.d.ts +10 -0
- package/dist/factory/rulesets/index.d.ts.map +1 -0
- package/dist/factory/rulesets/index.js +17 -0
- package/dist/factory/rulesets/index.js.map +1 -0
- package/dist/factory/rulesets/ruleset.d.ts +10 -0
- package/dist/factory/rulesets/ruleset.d.ts.map +1 -0
- package/dist/factory/rulesets/ruleset.js +20 -0
- package/dist/factory/rulesets/ruleset.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/input/files.d.ts +6 -0
- package/dist/input/files.d.ts.map +1 -0
- package/dist/input/files.js +1 -0
- package/dist/input/files.js.map +1 -0
- package/dist/input/imports/parsers.d.ts +3 -0
- package/dist/input/imports/parsers.d.ts.map +1 -0
- package/dist/input/imports/parsers.js +1 -0
- package/dist/input/imports/parsers.js.map +1 -0
- package/dist/input/imports/plugins.d.ts +2 -0
- package/dist/input/imports/plugins.d.ts.map +1 -0
- package/dist/input/imports/plugins.js +1 -0
- package/dist/input/imports/plugins.js.map +1 -0
- package/dist/input/index.d.ts +22 -0
- package/dist/input/index.d.ts.map +1 -0
- package/dist/input/index.js +1 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/parsers.d.ts +3 -0
- package/dist/input/parsers.d.ts.map +1 -0
- package/dist/input/parsers.js +1 -0
- package/dist/input/parsers.js.map +1 -0
- package/dist/input/plugins.d.ts +5 -0
- package/dist/input/plugins.d.ts.map +1 -0
- package/dist/input/plugins.js +1 -0
- package/dist/input/plugins.js.map +1 -0
- package/dist/input/rules/entry/index.d.ts +7 -0
- package/dist/input/rules/entry/index.d.ts.map +1 -0
- package/dist/input/rules/entry/index.js +1 -0
- package/dist/input/rules/entry/index.js.map +1 -0
- package/dist/input/rules/entry/record/index.d.ts +3 -0
- package/dist/input/rules/entry/record/index.d.ts.map +1 -0
- package/dist/input/rules/entry/record/index.js +1 -0
- package/dist/input/rules/entry/record/index.js.map +1 -0
- package/dist/input/rules/entry/record/state.d.ts +2 -0
- package/dist/input/rules/entry/record/state.d.ts.map +1 -0
- package/dist/input/rules/entry/record/state.js +1 -0
- package/dist/input/rules/entry/record/state.js.map +1 -0
- package/dist/input/rules/index.d.ts +14 -0
- package/dist/input/rules/index.d.ts.map +1 -0
- package/dist/input/rules/index.js +1 -0
- package/dist/input/rules/index.js.map +1 -0
- package/dist/output.d.ts +20 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +1 -0
- package/dist/output.js.map +1 -0
- package/dist/scopes.d.ts +3 -0
- package/dist/scopes.d.ts.map +1 -0
- package/dist/scopes.js +12 -0
- package/dist/scopes.js.map +1 -0
- package/package.json +4 -10
- package/src/factory/files.ts +20 -9
- package/src/factory/index.ts +4 -2
- package/src/factory/options/index.ts +2 -0
- package/src/factory/options/option/index.ts +25 -33
- package/src/factory/options/option/template/globals.ts +5 -0
- package/src/factory/options/option/{template.ts → template/index.ts} +6 -4
- package/src/factory/options/option/template/language/ecma.ts +3 -0
- package/src/factory/options/option/{params/language.ts → template/language/index.ts} +3 -3
- package/src/factory/options/option/template/language/source.ts +4 -0
- package/src/factory/options/option/template/linter.ts +8 -0
- package/src/factory/options/option/template/plugins.ts +1 -0
- package/src/factory/rulesets/index.ts +24 -0
- package/src/factory/rulesets/ruleset.ts +25 -0
- package/src/index.ts +25 -21
- package/src/input/files.ts +6 -0
- package/src/{inputs → input}/imports/parsers.ts +1 -1
- package/src/{inputs → input}/imports/plugins.ts +3 -2
- package/src/input/index.ts +23 -0
- package/src/input/parsers.ts +3 -0
- package/src/input/plugins.ts +3 -0
- package/src/input/rules/entry/index.ts +7 -0
- package/src/input/rules/entry/record/index.ts +3 -0
- package/src/input/rules/entry/record/state.ts +5 -0
- package/src/input/rules/index.ts +14 -0
- package/src/output.ts +23 -23
- package/src/scopes.ts +1 -1
- package/tsconfig.json +5 -6
- package/src/factory/options/option/params/globals.ts +0 -3
- package/src/factory/options/option/params/languageOptions/ecma.ts +0 -1
- package/src/factory/options/option/params/languageOptions/source.ts +0 -1
- package/src/factory/options/option/params/linter.ts +0 -4
- package/src/factory/options/option/params/plugins.ts +0 -1
- package/src/factory/ruleset/index.ts +0 -41
- package/src/factory/ruleset/rule.ts +0 -8
- package/src/factory/rulesets.ts +0 -16
- package/src/input.ts +0 -11
- package/src/inputs/files/base.ts +0 -3
- package/src/inputs/files/includes.ts +0 -3
- package/src/inputs/files.ts +0 -7
- package/src/inputs/imports.ts +0 -2
- package/src/inputs/parsers.ts +0 -3
- package/src/inputs/plugins.ts +0 -3
- package/src/inputs/rules/entry/index.ts +0 -3
- package/src/inputs/rules/entry/object/index.ts +0 -7
- package/src/inputs/rules/entry/object/state/index.ts +0 -4
- package/src/inputs/rules/overrides.ts +0 -4
- package/src/inputs/rules/preset.ts +0 -4
- package/src/inputs/rules.ts +0 -7
package/src/output.ts
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
import type { Input } from "
|
1
|
+
import type { Input } from ".";
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
3
|
+
export type Output = (
|
4
|
+
{
|
5
|
+
name: `linted/${string}`;
|
6
|
+
rules: Input["rules"]["rules"]["html"][number][1];
|
7
|
+
files: string[];
|
8
|
+
linterOptions: {
|
9
|
+
noInlineConfig: true;
|
10
|
+
reportUnusedDisableDirectives: "error";
|
11
|
+
};
|
12
|
+
languageOptions: {
|
13
|
+
sourceType?:
|
14
|
+
| "module"
|
15
|
+
| "script";
|
16
|
+
ecmaVersion?: "latest";
|
17
|
+
globals?: Table<true>;
|
18
|
+
parser?: unknown;
|
19
|
+
parserOptions?: Record<string, unknown>; // TODO: Change to Table<unknown> after lib update
|
20
|
+
};
|
21
|
+
plugins: Table<Record<"configs", unknown>>;
|
22
|
+
processor?: string;
|
23
|
+
}
|
24
|
+
)[];
|
package/src/scopes.ts
CHANGED
package/tsconfig.json
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
{
|
2
|
-
"display": "
|
2
|
+
"display": "jimmy/tsc",
|
3
|
+
"version": "5.6.2",
|
4
|
+
"help": "https://www.typescriptlang.org/tsconfig/#quick-nav-Top%20Level",
|
3
5
|
"$schema": "https://json.schemastore.org/tsconfig",
|
4
|
-
"_version": "5.6.1-core.0",
|
5
6
|
"include": [
|
6
7
|
"*.config.ts",
|
7
8
|
"src/**/*.ts",
|
@@ -10,8 +11,6 @@
|
|
10
11
|
],
|
11
12
|
"exclude": [],
|
12
13
|
"compilerOptions": {
|
13
|
-
/* http://aka.ms/tsconfig#quick-nav-Top%20Level */
|
14
|
-
|
15
14
|
// #region TYPE CHECKING
|
16
15
|
"allowUnreachableCode": false,
|
17
16
|
"allowUnusedLabels": false,
|
@@ -118,11 +117,11 @@
|
|
118
117
|
"es2023",
|
119
118
|
/* {CONFIGURE} */
|
120
119
|
],
|
121
|
-
"moduleDetection": "
|
120
|
+
// "moduleDetection": "auto",
|
122
121
|
// "noLib": true,
|
123
122
|
// "reactNamespace": "",
|
124
123
|
"target": "es2022",
|
125
|
-
"useDefineForClassFields": true
|
124
|
+
// "useDefineForClassFields": true /* @default: target > es2022 : true; else : false*/,
|
126
125
|
// #endregion
|
127
126
|
|
128
127
|
|
@@ -1 +0,0 @@
|
|
1
|
-
export type Ecma = "latest";
|
@@ -1 +0,0 @@
|
|
1
|
-
export type Source = "module" | "script";
|
@@ -1 +0,0 @@
|
|
1
|
-
export type Plugins<PluginId extends string> = Record<literalful<PluginId>, { configs: unknown }>;
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import type { Input } from "@eslinted/core";
|
2
|
-
import type { Scope } from "@eslinted/core";
|
3
|
-
import { Rule } from "./rule";
|
4
|
-
|
5
|
-
export { Rule };
|
6
|
-
export class Ruleset<S extends Scope> {
|
7
|
-
public readonly ruleset: readonly Rule[];
|
8
|
-
public overrides: Null<Rule> = null;
|
9
|
-
|
10
|
-
constructor(private readonly scope: literalful<S>, ...rules: readonly Rule[]) {
|
11
|
-
try {
|
12
|
-
this.ruleset = [...rules];
|
13
|
-
}
|
14
|
-
catch (e) { throw new Error(`linted.factory.Ruleset`, { cause: e }); }
|
15
|
-
}
|
16
|
-
|
17
|
-
public get id() {
|
18
|
-
const { scope } = this;
|
19
|
-
|
20
|
-
return scope;
|
21
|
-
}
|
22
|
-
|
23
|
-
public get records() {
|
24
|
-
try {
|
25
|
-
const { ruleset, overrides } = this;
|
26
|
-
|
27
|
-
return [
|
28
|
-
...ruleset.map(rules => [rules.id, rules.rules] as const),
|
29
|
-
...overrides === null ? [] : [[overrides.id, overrides.rules] as const] as const,
|
30
|
-
];
|
31
|
-
}
|
32
|
-
catch (e) { throw new Error(`linted.factory.Ruleset: records`, { cause: e }); }
|
33
|
-
}
|
34
|
-
|
35
|
-
public override(overrides: undefined | Input["rules"]["rules"][Scope][number][1]) {
|
36
|
-
if (typeof overrides !== "undefined")
|
37
|
-
this.overrides = new Rule("override", overrides);
|
38
|
-
|
39
|
-
return this;
|
40
|
-
}
|
41
|
-
}
|
package/src/factory/rulesets.ts
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
import type { Input } from "@eslinted/core";
|
2
|
-
import type { Scope } from "@eslinted/core";
|
3
|
-
import { Ruleset, Rule } from "./ruleset";
|
4
|
-
|
5
|
-
export class Rulesets {
|
6
|
-
constructor(private readonly input: Input["rules"]) {}
|
7
|
-
|
8
|
-
public ruleset<S extends Scope>(scope: literalful<S>): Ruleset<S> {
|
9
|
-
try {
|
10
|
-
const { rules, overrides } = this.input;
|
11
|
-
|
12
|
-
return new Ruleset<S>(scope, ...rules[scope].map(args => new Rule(...args))).override(overrides[scope]);
|
13
|
-
}
|
14
|
-
catch (e) { throw new Error(`linted.factory.Rulesets/ruleset/scope:${scope}`, { cause: e }); }
|
15
|
-
}
|
16
|
-
}
|
package/src/input.ts
DELETED
@@ -1,11 +0,0 @@
|
|
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
|
-
}
|
package/src/inputs/files/base.ts
DELETED
package/src/inputs/files.ts
DELETED
package/src/inputs/imports.ts
DELETED
package/src/inputs/parsers.ts
DELETED
package/src/inputs/plugins.ts
DELETED