@eslinted/core 18.9.0-rc.1 → 18.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/factory/index.d.ts +950 -16141
- package/dist/factory/index.d.ts.map +1 -1
- package/dist/factory/index.js +10 -8
- package/dist/factory/index.js.map +1 -1
- package/dist/factory/manifests.d.ts +9 -9
- package/dist/factory/manifests.d.ts.map +1 -1
- package/dist/factory/manifests.js.map +1 -1
- package/dist/factory/scopes/css.d.ts +9 -9
- package/dist/factory/scopes/css.d.ts.map +1 -1
- package/dist/factory/scopes/css.js.map +1 -1
- package/dist/factory/scopes/html.d.ts +10 -10
- package/dist/factory/scopes/html.d.ts.map +1 -1
- package/dist/factory/scopes/html.js.map +1 -1
- package/dist/factory/scopes/js.d.ts +7 -7
- package/dist/factory/scopes/js.d.ts.map +1 -1
- package/dist/factory/scopes/js.js +3 -1
- package/dist/factory/scopes/js.js.map +1 -1
- package/dist/factory/scopes/json.d.ts +8 -8
- package/dist/factory/scopes/json.d.ts.map +1 -1
- package/dist/factory/scopes/json.js +3 -1
- package/dist/factory/scopes/json.js.map +1 -1
- package/dist/factory/scopes/jsonc.d.ts +9 -8
- package/dist/factory/scopes/jsonc.d.ts.map +1 -1
- package/dist/factory/scopes/jsonc.js +4 -1
- package/dist/factory/scopes/jsonc.js.map +1 -1
- package/dist/factory/scopes/manifest/index.d.ts +11 -19
- package/dist/factory/scopes/manifest/index.d.ts.map +1 -1
- package/dist/factory/scopes/manifest/index.js.map +1 -1
- package/dist/factory/scopes/mocha.d.ts +15 -15
- package/dist/factory/scopes/mocha.d.ts.map +1 -1
- package/dist/factory/scopes/mocha.js.map +1 -1
- package/dist/factory/scopes/svelte.d.ts +18 -20
- package/dist/factory/scopes/svelte.d.ts.map +1 -1
- package/dist/factory/scopes/svelte.js +3 -1
- package/dist/factory/scopes/svelte.js.map +1 -1
- package/dist/factory/scopes/ts.d.ts +16 -16
- package/dist/factory/scopes/ts.d.ts.map +1 -1
- package/dist/factory/scopes/ts.js.map +1 -1
- package/dist/factory/scopes/yml.d.ts +9 -9
- package/dist/factory/scopes/yml.d.ts.map +1 -1
- package/dist/factory/scopes/yml.js.map +1 -1
- package/dist/index.spec.js.map +1 -1
- package/dist/interface/input/imported.d.ts +2 -2
- package/dist/interface/input/imported.d.ts.map +1 -1
- package/dist/interface/input/index.d.ts +3 -3
- package/dist/interface/input/index.d.ts.map +1 -1
- package/dist/interface/input/scopes/defaults.d.ts +4 -4
- package/dist/interface/input/scopes/defaults.d.ts.map +1 -1
- package/dist/interface/input/scopes/extensions.d.ts +6 -6
- package/dist/interface/input/scopes/extensions.d.ts.map +1 -1
- package/dist/interface/output/configs/scoped/rules.d.ts +1 -1
- package/dist/interface/output/configs/scoped/rules.d.ts.map +1 -1
- package/dist/interface/output/configs/scoped/settings.d.ts +2 -2
- package/dist/interface/output/configs/scoped/settings.d.ts.map +1 -1
- package/dist/interface/output/index.d.ts +3 -3
- package/dist/interface/output/index.d.ts.map +1 -1
- package/dist/interface/proto/config/index.d.ts +14 -14
- package/dist/interface/proto/config/index.d.ts.map +1 -1
- package/dist/interface/proto/config/rule/index.d.ts +2 -2
- package/dist/interface/proto/config/rule/index.d.ts.map +1 -1
- package/dist/interface/proto/config/utility/index.d.ts +2 -2
- package/dist/interface/proto/config/utility/index.d.ts.map +1 -1
- package/dist/scopes/imports/index.d.ts +2 -2
- package/dist/scopes/imports/index.d.ts.map +1 -1
- package/dist/scopes/tree/index.d.ts +1 -1
- package/dist/scopes/tree/index.d.ts.map +1 -1
- package/dist/scopes/tree/index.js.map +1 -1
- package/package.json +1 -1
- package/src/factory/index.ts +37 -35
- package/src/factory/manifests.ts +1 -1
- package/src/factory/scopes/css.ts +7 -7
- package/src/factory/scopes/html.ts +9 -9
- package/src/factory/scopes/js.ts +7 -5
- package/src/factory/scopes/json.ts +8 -6
- package/src/factory/scopes/jsonc.ts +9 -6
- package/src/factory/scopes/manifest/index.ts +29 -13
- package/src/factory/scopes/mocha.ts +7 -7
- package/src/factory/scopes/svelte.ts +12 -10
- package/src/factory/scopes/ts.ts +8 -8
- package/src/factory/scopes/yml.ts +8 -8
- package/src/index.spec.ts +1 -1
- package/src/interface/input/imported.ts +3 -3
- package/src/interface/input/index.ts +5 -5
- package/src/interface/input/scopes/defaults.ts +4 -4
- package/src/interface/input/scopes/extensions.ts +6 -6
- package/src/interface/output/configs/scoped/rules.ts +2 -2
- package/src/interface/output/configs/scoped/settings.ts +5 -3
- package/src/interface/output/index.ts +3 -3
- package/src/interface/proto/config/index.ts +14 -14
- package/src/interface/proto/config/rule/index.ts +4 -4
- package/src/interface/proto/config/utility/index.ts +3 -3
- package/src/scopes/imports/index.ts +2 -2
- package/src/scopes/tree/index.ts +6 -6
@@ -1,16 +1,32 @@
|
|
1
|
-
import type globals from "globals";
|
2
1
|
import type { Imports } from "../../../scopes";
|
3
2
|
|
4
|
-
export abstract class ScopeManifest
|
5
|
-
public abstract
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
export abstract class ScopeManifest {
|
4
|
+
public abstract processor:
|
5
|
+
| {
|
6
|
+
processor: string;
|
7
|
+
}
|
8
|
+
| Record<string, never>
|
9
|
+
;
|
10
|
+
public abstract language:
|
11
|
+
| {
|
12
|
+
language: string;
|
13
|
+
}
|
14
|
+
| Record<string, never>
|
15
|
+
;
|
16
|
+
public abstract parserOptions: {
|
17
|
+
parser:
|
18
|
+
| null
|
19
|
+
| Imports.Parsers
|
20
|
+
;
|
21
|
+
};
|
22
|
+
public abstract languageOptions: {
|
23
|
+
parser:
|
24
|
+
| null
|
25
|
+
| Imports.Parsers
|
26
|
+
;
|
27
|
+
globals:
|
28
|
+
| null
|
29
|
+
| string
|
30
|
+
;
|
31
|
+
};
|
16
32
|
}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
2
|
|
3
3
|
export default class MochaManifest extends ScopeManifest {
|
4
|
-
public
|
4
|
+
public languageOptions = {
|
5
5
|
parser: null,
|
6
|
-
globals: "mocha",
|
7
|
-
}
|
8
|
-
public
|
6
|
+
globals: "mocha" as const,
|
7
|
+
};
|
8
|
+
public parserOptions = {
|
9
9
|
// MUST BE IDENTICAL TO TS PARSER OPTIONS (eventually see if can inherit)
|
10
10
|
parser: null,
|
11
11
|
ecmaFeatures: {
|
@@ -18,7 +18,7 @@ export default class MochaManifest extends ScopeManifest {
|
|
18
18
|
warnOnUnsupportedTypeScriptVersion: false,
|
19
19
|
sourceType: "module",
|
20
20
|
ecmaVersion: 2023,
|
21
|
-
}
|
22
|
-
public
|
23
|
-
public
|
21
|
+
};
|
22
|
+
public processor = {};
|
23
|
+
public language = {};
|
24
24
|
}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
2
|
|
3
|
-
export default class SvelteManifest extends ScopeManifest
|
4
|
-
public
|
5
|
-
parser: "svelte",
|
3
|
+
export default class SvelteManifest extends ScopeManifest {
|
4
|
+
public languageOptions = {
|
5
|
+
parser: "svelte" as const,
|
6
6
|
globals: null,
|
7
|
-
}
|
8
|
-
public
|
9
|
-
parser: "ts",
|
10
|
-
extraFileExtensions: [".svelte"]
|
7
|
+
};
|
8
|
+
public parserOptions = {
|
9
|
+
parser: "ts" as const,
|
10
|
+
extraFileExtensions: [".svelte"],
|
11
11
|
ecmaFeatures: {
|
12
12
|
jsx: false,
|
13
13
|
globalReturn: true,
|
@@ -18,7 +18,9 @@ export default class SvelteManifest extends ScopeManifest<"svelte" | "ts"> {
|
|
18
18
|
warnOnUnsupportedTypeScriptVersion: false,
|
19
19
|
sourceType: "module",
|
20
20
|
ecmaVersion: 2023,
|
21
|
-
}
|
22
|
-
public
|
23
|
-
|
21
|
+
};
|
22
|
+
public processor = {
|
23
|
+
processor: "svelte/svelte",
|
24
|
+
};
|
25
|
+
public language = {};
|
24
26
|
}
|
package/src/factory/scopes/ts.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
2
|
|
3
|
-
export default class TsManifest extends ScopeManifest
|
4
|
-
public
|
5
|
-
parser: "ts",
|
3
|
+
export default class TsManifest extends ScopeManifest {
|
4
|
+
public languageOptions = {
|
5
|
+
parser: "ts" as const,
|
6
6
|
globals: null,
|
7
|
-
}
|
8
|
-
public
|
7
|
+
};
|
8
|
+
public parserOptions = {
|
9
9
|
// DOC: https://typescript-eslint.io/packages/parser/#configuration
|
10
10
|
// DOC:(USE-CASE): https://typescript-eslint.io/getting-started/typed-linting/
|
11
11
|
parser: null,
|
@@ -19,7 +19,7 @@ export default class TsManifest extends ScopeManifest<"ts"> {
|
|
19
19
|
warnOnUnsupportedTypeScriptVersion: false,
|
20
20
|
sourceType: "module",
|
21
21
|
ecmaVersion: 2023,
|
22
|
-
}
|
23
|
-
public
|
24
|
-
public
|
22
|
+
};
|
23
|
+
public processor = {};
|
24
|
+
public language = {};
|
25
25
|
}
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
2
|
|
3
|
-
export default class YmlManifest extends ScopeManifest
|
4
|
-
public
|
5
|
-
parser: "yml",
|
3
|
+
export default class YmlManifest extends ScopeManifest {
|
4
|
+
public languageOptions = {
|
5
|
+
parser: "yml" as const,
|
6
6
|
globals: null,
|
7
|
-
}
|
8
|
-
public
|
7
|
+
};
|
8
|
+
public parserOptions = {
|
9
9
|
/* DOC: https://github.com/ota-meshi/yaml-eslint-parser?tab=readme-ov-file#advanced-configuration */
|
10
10
|
parser: null,
|
11
11
|
defaultYAMLVersion: "1.2" /* @default: "1.2" | "1.1" */,
|
12
|
-
}
|
13
|
-
public
|
14
|
-
public
|
12
|
+
};
|
13
|
+
public processor = {};
|
14
|
+
public language = {};
|
15
15
|
}
|
package/src/index.spec.ts
CHANGED
@@ -24,7 +24,7 @@ describe("Core", function () {
|
|
24
24
|
});
|
25
25
|
it("containing only config-like members", function () {
|
26
26
|
expect(configs)
|
27
|
-
.satisfies((configs:
|
27
|
+
.satisfies((configs: unknown[]) => configs.every(config => typeof config === "object" && config !== null && "name" in config && typeof config.name === "string"));
|
28
28
|
});
|
29
29
|
});
|
30
30
|
describe("configs", function () {
|
@@ -4,9 +4,9 @@ export interface Imported<
|
|
4
4
|
Plugins extends string,
|
5
5
|
Parsers extends string,
|
6
6
|
> {
|
7
|
-
|
8
|
-
|
7
|
+
plugins: Config.Config<Plugins>["plugins"];
|
8
|
+
parsers: Record<
|
9
9
|
Parsers,
|
10
10
|
unknown
|
11
|
-
|
11
|
+
>;
|
12
12
|
}
|
@@ -3,10 +3,10 @@ import type { Imported } from "./imported";
|
|
3
3
|
import type { Defaults, Extensions } from "./scopes";
|
4
4
|
|
5
5
|
export interface Input {
|
6
|
-
|
7
|
-
Imports.
|
8
|
-
Imports.
|
6
|
+
imports: Imported<
|
7
|
+
Imports.Plugins,
|
8
|
+
Imports.Parsers
|
9
9
|
>;
|
10
|
-
|
11
|
-
|
10
|
+
defaults: Defaults<Scope>;
|
11
|
+
extensions: Extensions<Scope>;
|
12
12
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { Config } from "../../proto";
|
2
2
|
|
3
3
|
export interface Defaults<Scopes extends string> {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
settings: Config.Config["linterOptions"] & Config.Config["languageOptions"];
|
5
|
+
files: Record<Scopes, string[]>;
|
6
|
+
ignores: Record<"*" | Scopes, string[]>;
|
7
|
+
rules: Record<Scopes, Config.Rule.NamedRuleBag[]>;
|
8
8
|
}
|
@@ -2,17 +2,17 @@ import type { Defaults } from "./defaults";
|
|
2
2
|
|
3
3
|
export type Extensions<Scopes extends string> = (
|
4
4
|
& {
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
"*"?: Partial<Defaults<Scopes>["settings"]> & {
|
6
|
+
override?: boolean;
|
7
|
+
ignores?: Defaults<Scopes>["ignores"]["*"];
|
8
8
|
};
|
9
9
|
}
|
10
10
|
& Partial<Record<
|
11
11
|
Scopes,
|
12
12
|
{
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
files?: Defaults<Scopes>["files"][Scopes];
|
14
|
+
ignores?: Defaults<Scopes>["ignores"][Scopes];
|
15
|
+
rules?: Defaults<Scopes>["rules"][Scopes][number]["rules"];
|
16
16
|
}
|
17
17
|
>>
|
18
18
|
);
|
@@ -1,12 +1,14 @@
|
|
1
1
|
import type { Config } from "../../../proto";
|
2
2
|
|
3
|
-
export type Settings
|
4
|
-
`linted/${
|
3
|
+
export type Settings = Config.PickConfig<
|
4
|
+
`linted/${string}`,
|
5
5
|
| "files"
|
6
6
|
| "ignores"
|
7
7
|
| "processor"
|
8
8
|
| "language"
|
9
9
|
| "settings",
|
10
10
|
string,
|
11
|
-
{
|
11
|
+
{
|
12
|
+
languageOptions: object;
|
13
|
+
}
|
12
14
|
>;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type * as Configs from "./configs";
|
2
|
-
import type { Imports
|
2
|
+
import type { Imports } from "../../scopes";
|
3
3
|
|
4
4
|
export type Output = readonly [
|
5
|
-
Configs.Global.Plugins<Imports.
|
5
|
+
Configs.Global.Plugins<Imports.Plugins>,
|
6
6
|
Configs.Global.Settings,
|
7
7
|
Configs.Global.Ignores,
|
8
|
-
...
|
8
|
+
...(Configs.Scoped.Settings | Configs.Scoped.Rules)[],
|
9
9
|
];
|
@@ -3,25 +3,25 @@ import type * as Rule from "./rule";
|
|
3
3
|
export type { Rule };
|
4
4
|
export type * from "./utility";
|
5
5
|
export interface Config<Plugins extends string = string> {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
name: `linted/${string}`;
|
7
|
+
plugins: Record<Plugins, unknown>;
|
8
|
+
files: string[];
|
9
|
+
ignores: string[];
|
10
|
+
rules: Rule.RuleBag;
|
11
|
+
linterOptions: {
|
12
|
+
noInlineConfig: boolean;
|
13
|
+
reportUnusedDisableDirectives:
|
14
14
|
| "error"
|
15
15
|
| "warn"
|
16
16
|
| "off"
|
17
17
|
;
|
18
18
|
};
|
19
|
-
|
20
|
-
|
19
|
+
languageOptions: {
|
20
|
+
sourceType:
|
21
21
|
| "module"
|
22
22
|
| "script"
|
23
23
|
;
|
24
|
-
|
24
|
+
ecmaVersion:
|
25
25
|
| "latest"
|
26
26
|
| 3
|
27
27
|
| 5
|
@@ -37,7 +37,7 @@ export interface Config<Plugins extends string = string> {
|
|
37
37
|
| 2024
|
38
38
|
;
|
39
39
|
};
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
processor?: string;
|
41
|
+
language?: string;
|
42
|
+
settings?: Record<string, unknown>;
|
43
43
|
}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
export interface NamedRuleBag {
|
2
2
|
id: string;
|
3
|
-
|
3
|
+
rules: RuleBag;
|
4
4
|
}
|
5
|
-
export type RuleBag =
|
5
|
+
export type RuleBag = Record<
|
6
6
|
string,
|
7
7
|
| RuleState
|
8
|
-
| readonly [RuleState, ...
|
9
|
-
|
8
|
+
| readonly [RuleState, ...unknown[]]
|
9
|
+
>;
|
10
10
|
export type RuleState = (
|
11
11
|
| "error"
|
12
12
|
| "warn"
|
@@ -12,8 +12,8 @@ export type PickConfig<
|
|
12
12
|
> = (
|
13
13
|
& Rest
|
14
14
|
& Pick<Config<Plugins>, Picks>
|
15
|
-
& {
|
16
|
-
&
|
15
|
+
& { name: Name }
|
16
|
+
& Partial<Record<
|
17
17
|
Exclude<
|
18
18
|
keyof Config,
|
19
19
|
| "name"
|
@@ -21,5 +21,5 @@ export type PickConfig<
|
|
21
21
|
| Picks
|
22
22
|
>,
|
23
23
|
never
|
24
|
-
|
24
|
+
>>
|
25
25
|
);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export namespace Imports {
|
2
|
-
export type
|
2
|
+
export type Plugins = (
|
3
3
|
| "@stylistic"
|
4
4
|
| "@typescript-eslint"
|
5
5
|
| "mocha"
|
@@ -12,7 +12,7 @@ export namespace Imports {
|
|
12
12
|
| "jsonc"
|
13
13
|
| "yml"
|
14
14
|
);
|
15
|
-
export type
|
15
|
+
export type Parsers = (
|
16
16
|
| "ts"
|
17
17
|
| "svelte"
|
18
18
|
| "html"
|
package/src/scopes/tree/index.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { Scope } from "..";
|
2
2
|
|
3
|
-
export const tree: [Scope,
|
4
|
-
["jsonc", ["json"]
|
5
|
-
["mocha", ["ts"]
|
6
|
-
["svelte", ["ts"]
|
7
|
-
["ts", ["js"]
|
8
|
-
]
|
3
|
+
export const tree: [Scope, Scope[]][] = [
|
4
|
+
["jsonc", ["json"]] as const,
|
5
|
+
["mocha", ["ts"]] as const,
|
6
|
+
["svelte", ["ts"]] as const,
|
7
|
+
["ts", ["js"]] as const,
|
8
|
+
];
|