@eslinted/core 0.8.0-rc.1 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/boundary/boundary.d.ts +10 -5
- package/dist/boundary/boundary.d.ts.map +1 -1
- package/dist/boundary/boundary.js +1 -2
- package/dist/boundary/boundary.js.map +1 -1
- package/dist/boundary/input/input.d.ts +7 -4
- package/dist/boundary/input/input.d.ts.map +1 -1
- package/dist/boundary/input/parsers/parsers.d.ts +2 -2
- package/dist/boundary/input/parsers/parsers.d.ts.map +1 -1
- package/dist/boundary/input/parsers.d.ts +7 -0
- package/dist/boundary/input/parsers.d.ts.map +1 -0
- package/dist/boundary/input/parsers.js +2 -0
- package/dist/boundary/input/parsers.js.map +1 -0
- package/dist/boundary/input/plugins/plugins.d.ts +2 -1
- package/dist/boundary/input/plugins/plugins.d.ts.map +1 -1
- package/dist/boundary/input/plugins.d.ts +7 -0
- package/dist/boundary/input/plugins.d.ts.map +1 -0
- package/dist/boundary/input/plugins.js +2 -0
- package/dist/boundary/input/plugins.js.map +1 -0
- package/dist/boundary/input.d.ts +8 -0
- package/dist/boundary/input.d.ts.map +1 -0
- package/dist/boundary/input.js +2 -0
- package/dist/boundary/input.js.map +1 -0
- package/dist/boundary/output/IConfig.d.ts +19 -0
- package/dist/boundary/output/IConfig.d.ts.map +1 -0
- package/dist/boundary/output/IConfig.js +2 -0
- package/dist/boundary/output/IConfig.js.map +1 -0
- package/dist/boundary/output/output.d.ts +2 -2
- package/dist/boundary/output/output.d.ts.map +1 -1
- package/dist/boundary/output.d.ts +3 -0
- package/dist/boundary/output.d.ts.map +1 -0
- package/dist/boundary/output.js +2 -0
- package/dist/boundary/output.js.map +1 -0
- package/dist/factory/factory.d.ts +5 -0
- package/dist/factory/factory.d.ts.map +1 -0
- package/dist/factory/{Factory.js → factory.js} +3 -3
- package/dist/factory/factory.js.map +1 -0
- package/dist/factory/files/Files.d.ts +1 -1
- package/dist/factory/files/Files.d.ts.map +1 -1
- package/dist/factory/files/Files.js +9 -4
- package/dist/factory/files/Files.js.map +1 -1
- package/dist/factory/options/Options.d.ts +1 -3
- package/dist/factory/options/Options.d.ts.map +1 -1
- package/dist/factory/options/Options.js +1 -1
- package/dist/factory/options/Options.js.map +1 -1
- package/dist/factory/options/option/Option.d.ts +8 -22
- package/dist/factory/options/option/Option.d.ts.map +1 -1
- package/dist/factory/options/option/Option.js +33 -23
- package/dist/factory/options/option/Option.js.map +1 -1
- package/dist/factory/options/option/html/index.d.ts.map +1 -1
- package/dist/factory/options/option/html/index.js +7 -2
- package/dist/factory/options/option/html/index.js.map +1 -1
- package/dist/factory/options/option/js/index.d.ts.map +1 -1
- package/dist/factory/options/option/js/index.js +9 -4
- package/dist/factory/options/option/js/index.js.map +1 -1
- package/dist/factory/options/option/json/index.d.ts.map +1 -1
- package/dist/factory/options/option/json/index.js +7 -2
- package/dist/factory/options/option/json/index.js.map +1 -1
- package/dist/factory/options/option/jsonc/index.d.ts.map +1 -1
- package/dist/factory/options/option/jsonc/index.js +7 -2
- package/dist/factory/options/option/jsonc/index.js.map +1 -1
- package/dist/factory/options/option/svelte/index.d.ts.map +1 -1
- package/dist/factory/options/option/svelte/index.js +16 -11
- package/dist/factory/options/option/svelte/index.js.map +1 -1
- package/dist/factory/options/option/ts/index.d.ts.map +1 -1
- package/dist/factory/options/option/ts/index.js +14 -9
- package/dist/factory/options/option/ts/index.js.map +1 -1
- package/dist/factory/options/option/yml/index.d.ts.map +1 -1
- package/dist/factory/options/option/yml/index.js +7 -2
- package/dist/factory/options/option/yml/index.js.map +1 -1
- package/dist/factory/ruleset/Ruleset.d.ts +1 -1
- package/dist/factory/ruleset/Ruleset.d.ts.map +1 -1
- package/dist/factory/ruleset/Ruleset.js +31 -11
- package/dist/factory/ruleset/Ruleset.js.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/scopes/scopes.d.ts.map +1 -0
- package/dist/scopes/scopes.js.map +1 -0
- package/package.json +14 -22
- package/src/boundary/input/{parsers/parsers.ts → parsers.ts} +2 -2
- package/src/boundary/input/{plugins/plugins.ts → plugins.ts} +2 -1
- package/src/boundary/input.ts +9 -0
- package/src/boundary/output.ts +3 -0
- package/src/factory/factory.ts +10 -0
- package/src/factory/files/Files.ts +13 -5
- package/src/factory/options/option/Option.ts +71 -51
- package/src/factory/options/option/html/index.ts +10 -2
- package/src/factory/options/option/js/index.ts +12 -4
- package/src/factory/options/option/json/index.ts +10 -2
- package/src/factory/options/option/jsonc/index.ts +10 -2
- package/src/factory/options/option/svelte/index.ts +19 -11
- package/src/factory/options/option/ts/index.ts +17 -9
- package/src/factory/options/option/yml/index.ts +10 -2
- package/src/factory/options/{Options.ts → options.ts} +0 -2
- package/src/factory/ruleset/Ruleset.ts +47 -15
- package/src/index.ts +9 -13
- package/dist/boundary/scopes/scopes.d.ts.map +0 -1
- package/dist/boundary/scopes/scopes.js.map +0 -1
- package/dist/factory/Factory.d.ts +0 -7
- package/dist/factory/Factory.d.ts.map +0 -1
- package/dist/factory/Factory.js.map +0 -1
- package/src/boundary/boundary.ts +0 -11
- package/src/boundary/input/input.ts +0 -5
- package/src/boundary/output/output.ts +0 -3
- package/src/factory/Factory.ts +0 -13
- /package/dist/{boundary/scopes → scopes}/scopes.d.ts +0 -0
- /package/dist/{boundary/scopes → scopes}/scopes.js +0 -0
- /package/src/boundary/output/{config/IConfig.ts → IConfig.ts} +0 -0
- /package/src/boundary/output/{config/interface → interface}/option/IOption.d.ts +0 -0
- /package/src/boundary/output/{config/interface → interface}/option/language/IOLanguage.d.ts +0 -0
- /package/src/boundary/output/{config/interface → interface}/option/language/ecma/IOLanguageEcma.d.ts +0 -0
- /package/src/boundary/output/{config/interface → interface}/option/language/globals/IOLanguageGlobals.d.ts +0 -0
- /package/src/boundary/output/{config/interface → interface}/option/language/source/IOLanguageSource.d.ts +0 -0
- /package/src/boundary/output/{config/interface → interface}/option/linter/IOLinter.d.ts +0 -0
- /package/src/boundary/output/{config/interface → interface}/option/plugins/IOPlugins.d.ts +0 -0
- /package/src/boundary/output/{config/interface → interface}/option/processor/IOProcessor.d.ts +0 -0
- /package/src/boundary/output/{config/interface → interface}/rules/IRule.d.ts +0 -0
- /package/src/boundary/output/{config/interface → interface}/rules/state/RuleSeverity.d.ts +0 -0
- /package/src/{boundary/scopes → scopes}/scopes.ts +0 -0
@@ -16,19 +16,27 @@ export default class SvelteOption extends Option<
|
|
16
16
|
public readonly processor = { processor: "svelte/svelte" } as const;
|
17
17
|
|
18
18
|
public get languageOptions() {
|
19
|
-
|
19
|
+
try {
|
20
|
+
const [parser, tsParser] = this.parser;
|
20
21
|
|
21
|
-
|
22
|
-
ecmaVersion: "latest",
|
23
|
-
sourceType: "module",
|
24
|
-
parser,
|
25
|
-
parserOptions: {
|
22
|
+
return {
|
26
23
|
ecmaVersion: "latest",
|
27
24
|
sourceType: "module",
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
25
|
+
parser,
|
26
|
+
parserOptions: {
|
27
|
+
ecmaVersion: "latest",
|
28
|
+
sourceType: "module",
|
29
|
+
project: "tsconfig.json",
|
30
|
+
extraFileExtensions: [".svelte"] as const,
|
31
|
+
parser: tsParser,
|
32
|
+
},
|
33
|
+
} as const;
|
34
|
+
}
|
35
|
+
catch (e) {
|
36
|
+
throw new Error(
|
37
|
+
`linted.factory.options.svelte: languageOptions`,
|
38
|
+
{ cause: e },
|
39
|
+
);
|
40
|
+
}
|
33
41
|
}
|
34
42
|
}
|
@@ -13,17 +13,25 @@ export default class TsOption extends Option<
|
|
13
13
|
public readonly processor = {} as const;
|
14
14
|
|
15
15
|
public get languageOptions() {
|
16
|
-
|
16
|
+
try {
|
17
|
+
const [parser] = this.parser;
|
17
18
|
|
18
|
-
|
19
|
-
ecmaVersion: "latest",
|
20
|
-
sourceType: "module",
|
21
|
-
parser,
|
22
|
-
parserOptions: {
|
19
|
+
return {
|
23
20
|
ecmaVersion: "latest",
|
24
21
|
sourceType: "module",
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
parser,
|
23
|
+
parserOptions: {
|
24
|
+
ecmaVersion: "latest",
|
25
|
+
sourceType: "module",
|
26
|
+
project: "tsconfig.json",
|
27
|
+
},
|
28
|
+
} as const;
|
29
|
+
}
|
30
|
+
catch (e) {
|
31
|
+
throw new Error(
|
32
|
+
`linted.factory.options.ts: languageOptions`,
|
33
|
+
{ cause: e },
|
34
|
+
);
|
35
|
+
}
|
28
36
|
}
|
29
37
|
}
|
@@ -11,8 +11,16 @@ export default class YmlOption extends Option<
|
|
11
11
|
public readonly processor = {} as const;
|
12
12
|
|
13
13
|
public get languageOptions() {
|
14
|
-
|
14
|
+
try {
|
15
|
+
const [parser] = this.parser;
|
15
16
|
|
16
|
-
|
17
|
+
return { parser } as const;
|
18
|
+
}
|
19
|
+
catch (e) {
|
20
|
+
throw new Error(
|
21
|
+
`linted.factory.options.yml: languageOptions`,
|
22
|
+
{ cause: e },
|
23
|
+
);
|
24
|
+
}
|
17
25
|
}
|
18
26
|
}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import type { Scope } from "../Factory.js";
|
2
1
|
import JsOption from "./option/js/index.js";
|
3
2
|
import TsOption from "./option/ts/index.js";
|
4
3
|
import SvelteOption from "./option/svelte/index.js";
|
@@ -7,7 +6,6 @@ import JsonOption from "./option/json/index.js";
|
|
7
6
|
import JsoncOption from "./option/jsonc/index.js";
|
8
7
|
import YmlOption from "./option/yml/index.js";
|
9
8
|
|
10
|
-
export type { Scope };
|
11
9
|
export default {
|
12
10
|
js: JsOption,
|
13
11
|
ts: TsOption,
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import type { Scope } from "../../scopes/scopes.js";
|
1
2
|
import Rule from "./rule/Rule.js";
|
2
|
-
import type { Scope } from "../Factory.js";
|
3
3
|
|
4
4
|
export { Rule };
|
5
5
|
export default class Ruleset<S extends Scope> {
|
@@ -10,31 +10,63 @@ export default class Ruleset<S extends Scope> {
|
|
10
10
|
private readonly scope: literalful<S>,
|
11
11
|
...ruleset: readonly Rule[]
|
12
12
|
) {
|
13
|
-
|
13
|
+
try {
|
14
|
+
this.ruleset = [...ruleset];
|
15
|
+
}
|
16
|
+
catch (e) {
|
17
|
+
throw new Error(
|
18
|
+
`linted.factory.Ruleset`,
|
19
|
+
{ cause: e },
|
20
|
+
);
|
21
|
+
}
|
14
22
|
}
|
15
23
|
|
16
24
|
public get id() {
|
17
|
-
|
25
|
+
try {
|
26
|
+
const { scope } = this;
|
18
27
|
|
19
|
-
|
28
|
+
return scope;
|
29
|
+
}
|
30
|
+
catch (e) {
|
31
|
+
throw new Error(
|
32
|
+
`linted.factory.Ruleset: id`,
|
33
|
+
{ cause: e },
|
34
|
+
);
|
35
|
+
}
|
20
36
|
}
|
21
37
|
|
22
38
|
public get records() {
|
23
|
-
|
39
|
+
try {
|
40
|
+
const { ruleset, overrides } = this;
|
24
41
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
42
|
+
return [
|
43
|
+
...ruleset.map(rules => [rules.id, rules.rules] as const),
|
44
|
+
...overrides === null ? [] : [[overrides.id, overrides.rules] as const] as const,
|
45
|
+
];
|
46
|
+
}
|
47
|
+
catch (e) {
|
48
|
+
throw new Error(
|
49
|
+
`linted.factory.Ruleset: records`,
|
50
|
+
{ cause: e },
|
51
|
+
);
|
52
|
+
}
|
29
53
|
}
|
30
54
|
|
31
55
|
public override(overrides: undefined | IRule) {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
56
|
+
try {
|
57
|
+
if (typeof overrides !== "undefined")
|
58
|
+
this.overrides = new Rule(
|
59
|
+
"override",
|
60
|
+
overrides,
|
61
|
+
);
|
37
62
|
|
38
|
-
|
63
|
+
return this;
|
64
|
+
}
|
65
|
+
catch (e) {
|
66
|
+
throw new Error(
|
67
|
+
`linted.factory.Ruleset: override`,
|
68
|
+
{ cause: e },
|
69
|
+
);
|
70
|
+
}
|
39
71
|
}
|
40
72
|
}
|
package/src/index.ts
CHANGED
@@ -1,27 +1,23 @@
|
|
1
|
-
import scopes from "./
|
2
|
-
import type
|
3
|
-
|
4
|
-
Plugins,
|
5
|
-
Parsers,
|
6
|
-
IConfig,
|
7
|
-
} from "./boundary/boundary.js";
|
1
|
+
import scopes, { type Scope } from "./scopes/scopes.js";
|
2
|
+
import type Output from "./boundary/output.js";
|
3
|
+
import type Input from "./boundary/input.js";
|
8
4
|
import {
|
9
5
|
Options,
|
10
6
|
Files,
|
11
7
|
Ruleset,
|
12
8
|
Rule,
|
13
|
-
} from "./factory/
|
9
|
+
} from "./factory/factory.js";
|
14
10
|
|
15
|
-
export type { Scope };
|
11
|
+
export type { Scope, Output };
|
16
12
|
export { Ruleset, Rule };
|
17
13
|
export default function (
|
18
|
-
plugins: Plugins,
|
19
|
-
parsers: Parsers,
|
14
|
+
plugins: Input.Plugins,
|
15
|
+
parsers: Input.Parsers,
|
20
16
|
base: Record<Scope, string[]>,
|
21
17
|
includes: Particord<Scope, string[]>,
|
22
18
|
rulesets: { [S in Scope]: Ruleset<S> },
|
23
19
|
overrides: Particord<Scope, IRule>,
|
24
|
-
):
|
20
|
+
): Output[] {
|
25
21
|
try {
|
26
22
|
const files = new Files(
|
27
23
|
base,
|
@@ -107,7 +103,7 @@ export default function (
|
|
107
103
|
}
|
108
104
|
catch (e) {
|
109
105
|
throw new Error(
|
110
|
-
`linted
|
106
|
+
`linted.main`,
|
111
107
|
{ cause: e },
|
112
108
|
);
|
113
109
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../../../src/boundary/scopes/scopes.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM,iEAQF,CAAC;AAEX,eAAe,MAAM,CAAC;AACtB,MAAM,MAAM,KAAK,GAAG,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scopes.js","sourceRoot":"","sources":["../../../src/boundary/scopes/scopes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACb,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;CACG,CAAC;AAEX,eAAe,MAAM,CAAC"}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import Options from "./options/Options.js";
|
2
|
-
import Files from "./files/Files.js";
|
3
|
-
import Ruleset, { Rule } from "./ruleset/Ruleset.js";
|
4
|
-
import type { Scope } from "../index.js";
|
5
|
-
export type Blanka = ConstructorParameters<typeof Options["js"]>;
|
6
|
-
export { Options, Files, Ruleset, Rule, type Scope, };
|
7
|
-
//# sourceMappingURL=Factory.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Factory.d.ts","sourceRoot":"","sources":["../../src/factory/Factory.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,MAAM,kBAAkB,CAAC;AACrC,OAAO,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,MAAM,MAAM,GAAG,qBAAqB,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,EACJ,KAAK,KAAK,GACX,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../../src/factory/Factory.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,MAAM,kBAAkB,CAAC;AACrC,OAAO,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAIrD,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,GAEL,CAAC"}
|
package/src/boundary/boundary.ts
DELETED
package/src/factory/Factory.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
import Options from "./options/Options.js";
|
2
|
-
import Files from "./files/Files.js";
|
3
|
-
import Ruleset, { Rule } from "./ruleset/Ruleset.js";
|
4
|
-
import type { Scope } from "../index.js";
|
5
|
-
|
6
|
-
export type Blanka = ConstructorParameters<typeof Options["js"]>;
|
7
|
-
export {
|
8
|
-
Options,
|
9
|
-
Files,
|
10
|
-
Ruleset,
|
11
|
-
Rule,
|
12
|
-
type Scope,
|
13
|
-
};
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/src/boundary/output/{config/interface → interface}/option/language/ecma/IOLanguageEcma.d.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/src/boundary/output/{config/interface → interface}/option/processor/IOProcessor.d.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|