@eslinted/core 0.9.0-rc.6 → 0.9.0-rc.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/boundary/input/ruleRecord.d.ts +6 -0
- package/dist/boundary/input/ruleRecord.d.ts.map +1 -0
- package/dist/boundary/input/ruleRecord.js +2 -0
- package/dist/boundary/input/ruleRecord.js.map +1 -0
- package/dist/boundary/input.d.ts +2 -0
- package/dist/boundary/input.d.ts.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 +2 -2
- package/dist/factory/ruleset/Ruleset.js.map +1 -1
- package/dist/index.d.ts +2 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/boundary/input/ruleRecord.ts +6 -0
- package/src/boundary/input.ts +2 -0
- package/src/factory/ruleset/Ruleset.ts +2 -2
- package/src/index.ts +36 -3
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ruleRecord.d.ts","sourceRoot":"","sources":["../../../src/boundary/input/ruleRecord.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,SAAS;IACzB,MAAM;IACN,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,CAAC,OAAO,GAAG,MAAM,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;CACpF,CAAC;AAEF,YAAY,EAAE,UAAU,IAAI,OAAO,EAAE,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ruleRecord.js","sourceRoot":"","sources":["../../../src/boundary/input/ruleRecord.ts"],"names":[],"mappings":""}
|
package/dist/boundary/input.d.ts
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
import type plugins from "./input/plugins.js";
|
2
2
|
import type parsers from "./input/parsers.js";
|
3
|
+
import type ruleRecord from "./input/ruleRecord.js";
|
3
4
|
declare namespace Input {
|
4
5
|
type Plugins = plugins;
|
5
6
|
type Parsers = parsers;
|
7
|
+
type RuleRecord = ruleRecord;
|
6
8
|
}
|
7
9
|
export type { Input as default };
|
8
10
|
//# sourceMappingURL=input.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/boundary/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/boundary/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AAEpD,kBAAU,KAAK,CAAC;IACd,KAAY,OAAO,GAAG,OAAO,CAAC;IAC9B,KAAY,OAAO,GAAG,OAAO,CAAC;IAC9B,KAAY,UAAU,GAAG,UAAU,CAAC;CACrC;AAED,YAAY,EAAE,KAAK,IAAI,OAAO,EAAE,CAAC"}
|
@@ -5,7 +5,7 @@ export default class Ruleset<S extends Scope> {
|
|
5
5
|
private readonly scope;
|
6
6
|
readonly ruleset: readonly Rule[];
|
7
7
|
overrides: Null<Rule>;
|
8
|
-
constructor(scope: literalful<S>, ...
|
8
|
+
constructor(scope: literalful<S>, ...rules: readonly Rule[]);
|
9
9
|
get id(): literalful<S>;
|
10
10
|
get records(): (readonly [string, IRule])[];
|
11
11
|
override(overrides: undefined | IRule): this;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Ruleset.d.ts","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,CAAC,SAAS,KAAK;IAKxC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJxB,SAAgB,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;IAClC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAQ;gBAGjB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACrC,GAAG,
|
1
|
+
{"version":3,"file":"Ruleset.d.ts","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,CAAC,SAAS,KAAK;IAKxC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJxB,SAAgB,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;IAClC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAQ;gBAGjB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACrC,GAAG,KAAK,EAAE,SAAS,IAAI,EAAE;IAa3B,IAAW,EAAE,kBAYZ;IAED,IAAW,OAAO,iCAejB;IAEM,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,KAAK;CAiB7C"}
|
@@ -4,10 +4,10 @@ export default class Ruleset {
|
|
4
4
|
scope;
|
5
5
|
ruleset;
|
6
6
|
overrides = null;
|
7
|
-
constructor(scope, ...
|
7
|
+
constructor(scope, ...rules) {
|
8
8
|
this.scope = scope;
|
9
9
|
try {
|
10
|
-
this.ruleset = [...
|
10
|
+
this.ruleset = [...rules];
|
11
11
|
}
|
12
12
|
catch (e) {
|
13
13
|
throw new Error(`linted.factory.Ruleset`, { cause: e });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Ruleset.js","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO;IAKP;IAJH,OAAO,CAAkB;IAClC,SAAS,GAAe,IAAI,CAAC;IAEpC,YACmB,KAAoB,EACrC,GAAG,
|
1
|
+
{"version":3,"file":"Ruleset.js","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO;IAKP;IAJH,OAAO,CAAkB;IAClC,SAAS,GAAe,IAAI,CAAC;IAEpC,YACmB,KAAoB,EACrC,GAAG,KAAsB;QADR,UAAK,GAAL,KAAK,CAAe;QAGrC,IAAI,CAAC;YACH,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CACb,wBAAwB,EACxB,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAW,EAAE;QACX,IAAI,CAAC;YACH,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;YAEvB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CACb,4BAA4B,EAC5B,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAW,OAAO;QAChB,IAAI,CAAC;YACH,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;YAEpC,OAAO;gBACL,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAU,CAAC;gBACzD,GAAG,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,KAAK,CAAU,CAAU;aACjF,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CACb,iCAAiC,EACjC,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAC;QACJ,CAAC;IACH,CAAC;IAEM,QAAQ,CAAC,SAA4B;QAC1C,IAAI,CAAC;YACH,IAAI,OAAO,SAAS,KAAK,WAAW;gBAClC,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CACvB,UAAU,EACV,SAAS,CACV,CAAC;YAEJ,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CACb,kCAAkC,EAClC,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
import { type Scope } from "./scopes/scopes.js";
|
2
2
|
import type Output from "./boundary/output.js";
|
3
3
|
import type Input from "./boundary/input.js";
|
4
|
-
|
5
|
-
export
|
6
|
-
export { Ruleset, Rule };
|
7
|
-
export default function (plugins: Input.Plugins, parsers: Input.Parsers, base: Record<Scope, string[]>, includes: Particord<Scope, string[]>, rulesets: {
|
8
|
-
[S in Scope]: Ruleset<S>;
|
9
|
-
}, overrides: Particord<Scope, IRule>): Output[];
|
4
|
+
export type { Scope, Input, Output, };
|
5
|
+
export default function (plugins: Input.Plugins, parsers: Input.Parsers, base: Record<Scope, string[]>, includes: Particord<Scope, string[]>, rules: Record<Scope, readonly Input.RuleRecord[]>, overrides: Particord<Scope, IRule>): Output[];
|
10
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAe,EAAE,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAe,EAAE,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAQ7C,YAAY,EACV,KAAK,EACL,KAAK,EACL,MAAM,GACP,CAAC;AACF,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAC7B,QAAQ,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EACpC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,KAAK,CAAC,UAAU,EAAE,CAAC,EACjD,SAAS,EAAE,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,GACjC,MAAM,EAAE,CAwHV"}
|
package/dist/index.js
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
import scopes, {} from "./scopes/scopes.js";
|
2
2
|
import { Options, Files, Ruleset, Rule, } from "./factory/factory.js";
|
3
|
-
export
|
4
|
-
export default function (plugins, parsers, base, includes, rulesets, overrides) {
|
3
|
+
export default function (plugins, parsers, base, includes, rules, overrides) {
|
5
4
|
try {
|
6
|
-
const files = new Files(base, includes),
|
5
|
+
const files = new Files(base, includes), rulesets = {
|
6
|
+
js: new Ruleset("js", ...rules.js.map(args => new Rule(...args))),
|
7
|
+
ts: new Ruleset("ts", ...rules.ts.map(args => new Rule(...args))),
|
8
|
+
svelte: new Ruleset("svelte", ...rules.svelte.map(args => new Rule(...args))),
|
9
|
+
html: new Ruleset("html", ...rules.html.map(args => new Rule(...args))),
|
10
|
+
json: new Ruleset("json", ...rules.json.map(args => new Rule(...args))),
|
11
|
+
jsonc: new Ruleset("jsonc", ...rules.jsonc.map(args => new Rule(...args))),
|
12
|
+
yml: new Ruleset("yml", ...rules.yml.map(args => new Rule(...args))),
|
13
|
+
}, imports = {
|
7
14
|
js: [plugins.js, []],
|
8
15
|
ts: [plugins.ts, [parsers.ts]],
|
9
16
|
svelte: [
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAc,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,GACL,MAAM,sBAAsB,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAc,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,GACL,MAAM,sBAAsB,CAAC;AAO9B,MAAM,CAAC,OAAO,WACZ,OAAsB,EACtB,OAAsB,EACtB,IAA6B,EAC7B,QAAoC,EACpC,KAAiD,EACjD,SAAkC;IAElC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,IAAI,EACJ,QAAQ,CACT,EACD,QAAQ,GAAG;YACT,EAAE,EAAE,IAAI,OAAO,CACb,IAAI,EACJ,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAC3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,EACb,GAAG,OAAO,CAAC,IAAI,CAChB;iBACA,OAAO;YACV,KAAK,EAAE,IAAI,OAAO;iBACf,KAAK,CACJ,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EACpB,QAAQ,CAAC,KAAK,EACd,GAAG,OAAO,CAAC,KAAK,CACjB;iBACA,OAAO;YACV,GAAG,EAAE,IAAI,OAAO;iBACb,GAAG,CACF,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAClB,QAAQ,CAAC,GAAG,EACZ,GAAG,OAAO,CAAC,GAAG,CACf;iBACA,OAAO;SACX,CAAC;QAEF,OAAO,MAAM;aACV,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;aAC5B,IAAI,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,aAAa,EACb,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
package/src/boundary/input.ts
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
import type plugins from "./input/plugins.js";
|
2
2
|
import type parsers from "./input/parsers.js";
|
3
|
+
import type ruleRecord from "./input/ruleRecord.js";
|
3
4
|
|
4
5
|
namespace Input {
|
5
6
|
export type Plugins = plugins;
|
6
7
|
export type Parsers = parsers;
|
8
|
+
export type RuleRecord = ruleRecord;
|
7
9
|
}
|
8
10
|
|
9
11
|
export type { Input as default };
|
@@ -8,10 +8,10 @@ export default class Ruleset<S extends Scope> {
|
|
8
8
|
|
9
9
|
constructor(
|
10
10
|
private readonly scope: literalful<S>,
|
11
|
-
...
|
11
|
+
...rules: readonly Rule[]
|
12
12
|
) {
|
13
13
|
try {
|
14
|
-
this.ruleset = [...
|
14
|
+
this.ruleset = [...rules];
|
15
15
|
}
|
16
16
|
catch (e) {
|
17
17
|
throw new Error(
|
package/src/index.ts
CHANGED
@@ -8,14 +8,17 @@ import {
|
|
8
8
|
Rule,
|
9
9
|
} from "./factory/factory.js";
|
10
10
|
|
11
|
-
export type {
|
12
|
-
|
11
|
+
export type {
|
12
|
+
Scope,
|
13
|
+
Input,
|
14
|
+
Output,
|
15
|
+
};
|
13
16
|
export default function (
|
14
17
|
plugins: Input.Plugins,
|
15
18
|
parsers: Input.Parsers,
|
16
19
|
base: Record<Scope, string[]>,
|
17
20
|
includes: Particord<Scope, string[]>,
|
18
|
-
|
21
|
+
rules: Record<Scope, readonly Input.RuleRecord[]>,
|
19
22
|
overrides: Particord<Scope, IRule>,
|
20
23
|
): Output[] {
|
21
24
|
try {
|
@@ -23,6 +26,36 @@ export default function (
|
|
23
26
|
base,
|
24
27
|
includes,
|
25
28
|
),
|
29
|
+
rulesets = {
|
30
|
+
js: new Ruleset(
|
31
|
+
"js",
|
32
|
+
...rules.js.map(args => new Rule(...args)),
|
33
|
+
),
|
34
|
+
ts: new Ruleset(
|
35
|
+
"ts",
|
36
|
+
...rules.ts.map(args => new Rule(...args)),
|
37
|
+
),
|
38
|
+
svelte: new Ruleset(
|
39
|
+
"svelte",
|
40
|
+
...rules.svelte.map(args => new Rule(...args)),
|
41
|
+
),
|
42
|
+
html: new Ruleset(
|
43
|
+
"html",
|
44
|
+
...rules.html.map(args => new Rule(...args)),
|
45
|
+
),
|
46
|
+
json: new Ruleset(
|
47
|
+
"json",
|
48
|
+
...rules.json.map(args => new Rule(...args)),
|
49
|
+
),
|
50
|
+
jsonc: new Ruleset(
|
51
|
+
"jsonc",
|
52
|
+
...rules.jsonc.map(args => new Rule(...args)),
|
53
|
+
),
|
54
|
+
yml: new Ruleset(
|
55
|
+
"yml",
|
56
|
+
...rules.yml.map(args => new Rule(...args)),
|
57
|
+
),
|
58
|
+
},
|
26
59
|
imports: {
|
27
60
|
[S in Scope]: OmitFilesRuleset<ConstructorParameters<typeof Options[S]>>;
|
28
61
|
} = {
|