@eslinted/core 3.1.1 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/boundary/input/files/index.d.ts +5 -1
- package/dist/boundary/input/files/index.d.ts.map +1 -1
- package/dist/boundary/input/rules/index.d.ts +5 -1
- package/dist/boundary/input/rules/index.d.ts.map +1 -1
- package/dist/factory/files/index.d.ts +2 -3
- package/dist/factory/files/index.d.ts.map +1 -1
- package/dist/factory/files/index.js +5 -6
- package/dist/factory/files/index.js.map +1 -1
- package/dist/factory/options/option/index.js +1 -1
- package/dist/factory/options/option/index.js.map +1 -1
- package/dist/factory/rulesets/index.d.ts +2 -3
- package/dist/factory/rulesets/index.d.ts.map +1 -1
- package/dist/factory/rulesets/index.js +5 -7
- package/dist/factory/rulesets/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/boundary/input/files/index.ts +8 -1
- package/src/boundary/input/rules/index.ts +8 -1
- package/src/factory/files/index.ts +4 -5
- package/src/factory/options/option/index.ts +1 -1
- package/src/factory/rulesets/index.ts +4 -6
- package/src/index.ts +2 -2
- package/dist/factory/ruleset/index.d.ts +0 -13
- package/dist/factory/ruleset/index.d.ts.map +0 -1
- package/dist/factory/ruleset/index.js +0 -38
- package/dist/factory/ruleset/index.js.map +0 -1
- package/dist/factory/ruleset/rule/index.d.ts +0 -7
- package/dist/factory/ruleset/rule/index.d.ts.map +0 -1
- package/dist/factory/ruleset/rule/index.js +0 -9
- package/dist/factory/ruleset/rule/index.js.map +0 -1
@@ -1,4 +1,8 @@
|
|
1
1
|
import type Base from "./base/index.js";
|
2
2
|
import type Includes from "./includes/index.js";
|
3
|
-
|
3
|
+
type Files = {
|
4
|
+
base: Base;
|
5
|
+
includes: Includes;
|
6
|
+
};
|
7
|
+
export type { Base, Includes, Files, Files as default, };
|
4
8
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/boundary/input/files/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/boundary/input/files/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEhD,YAAY,EACV,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,KAAK,IAAI,OAAO,GACjB,CAAC"}
|
@@ -1,4 +1,8 @@
|
|
1
1
|
import type Preset from "./preset/index.js";
|
2
2
|
import type Overrides from "./overrides/index.js";
|
3
|
-
|
3
|
+
type Rules = {
|
4
|
+
preset: Preset;
|
5
|
+
overrides: Overrides;
|
6
|
+
};
|
7
|
+
export type { Preset, Overrides, Rules, Rules as default, };
|
4
8
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/boundary/input/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAElD,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/boundary/input/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAElD,KAAK,KAAK,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC;AAEtD,YAAY,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,KAAK,IAAI,OAAO,GACjB,CAAC"}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import type { Scope } from "../../scopes/index.js";
|
2
2
|
import type { Input } from "../../boundary/index.js";
|
3
3
|
export default class Files {
|
4
|
-
private readonly
|
5
|
-
|
6
|
-
constructor(base: Input.Files.Base, includes: Input.Files.Includes);
|
4
|
+
private readonly input;
|
5
|
+
constructor(input: Input.Files.Files);
|
7
6
|
files(scope: Scope): readonly string[];
|
8
7
|
}
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/factory/files/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,CAAC,OAAO,OAAO,KAAK;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/factory/files/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,CAAC,OAAO,OAAO,KAAK;IACZ,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK;IAE9C,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,MAAM,EAAE;CAQ9C"}
|
@@ -1,13 +1,12 @@
|
|
1
1
|
export default class Files {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
this.base = base;
|
6
|
-
this.includes = includes;
|
2
|
+
input;
|
3
|
+
constructor(input) {
|
4
|
+
this.input = input;
|
7
5
|
}
|
8
6
|
files(scope) {
|
9
7
|
try {
|
10
|
-
|
8
|
+
const { base, includes } = this.input;
|
9
|
+
return [...base[scope], ...includes[scope] ?? []];
|
11
10
|
}
|
12
11
|
catch (e) {
|
13
12
|
throw new Error(`linted.factory.Files/scope:${scope}`, { cause: e });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/factory/files/index.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,KAAK;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/factory/files/index.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,KAAK;IACK;IAA7B,YAA6B,KAAwB;QAAxB,UAAK,GAAL,KAAK,CAAmB;IAAG,CAAC;IAElD,KAAK,CAAC,KAAY;QACvB,IAAI,CAAC;YACH,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YAEtC,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,8BAA8B,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAAC,CAAC;IACrF,CAAC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/factory/options/option/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAM9B,MAAM,CAAC,OAAO,OAAgB,MAAM;IAmBhB;IACA;IACA;IACA;IAbD,aAAa,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,6BAA6B,EAAE,OAAO,EAAW,CAAC;IAS3G,YACkB,KAAwB,EACxB,OAAmB,EACnB,OAA4B,EAC5B,MAAmC;QAHnC,UAAK,GAAL,KAAK,CAAmB;QACxB,YAAO,GAAP,OAAO,CAAY;QACnB,YAAO,GAAP,OAAO,CAAqB;QAC5B,WAAM,GAAN,MAAM,CAA6B;IAClD,CAAC;IAEJ,IAAW,OAAO;QAChB,IAAI,CAAC;YACH,MAAM,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EACL,MAAM,GACP,GAAG,IAAI,CAAC;YAET,IAAI,OAAO,CAAC,EAAE,KAAK,KAAK;gBACtB,MAAM,IAAI,SAAS,CAAC,mCAAmC,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;iBACzG,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;gBACvB,OAAO,EAAE,CAAC;iBACP,CAAC;gBACJ,MAAM,QAAQ,GAAG,gBAAgB,KAAK,SAAS,OAAO,CAAC,EAAE,EAAW,CAAC;gBAErE,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE;oBAC7C,MAAM,IAAI,GAAG,GAAG,QAAQ,IAAI,MAAM,EAAW,CAAC;oBAE9C,OAAO;wBACL,IAAI;wBACJ,KAAK;wBACL,KAAK;wBACL,GAAG,MAAM;qBACV,CAAC;gBACJ,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,CAAC,KAAK,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAAC,CAAC;IACpG,CAAC;IAED,IAAY,MAAM;QAChB,IAAI,CAAC;YACH,MAAM,EACJ,OAAO,EACP,aAAa,EACb,eAAe,EACf,SAAS,GACV,GAAG,IAAI,CAAC;YAET,OAAO;gBACL,aAAa;gBACb,eAAe;gBACf,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/factory/options/option/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CA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AAC;QAAC,CAAC;IACpG,CAAC;IAED,IAAY,MAAM;QAChB,IAAI,CAAC;YACH,MAAM,EACJ,OAAO,EACP,aAAa,EACb,eAAe,EACf,SAAS,GACV,GAAG,IAAI,CAAC;YAET,OAAO;gBACL,OAAO;gBACP,aAAa;gBACb,eAAe;gBACf,GAAG,SAAS;aAOb,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,CAAC,KAAK,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAAC,CAAC;IACnG,CAAC;IAIS,OAAO,CAAC,IAAiB;QACjC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;CACF"}
|
@@ -2,9 +2,8 @@ import Ruleset from "./ruleset/index.js";
|
|
2
2
|
import type { Input } from "../../boundary/index.js";
|
3
3
|
import type { Scope } from "../../scopes/index.js";
|
4
4
|
export default class {
|
5
|
-
private readonly
|
6
|
-
|
7
|
-
constructor(preset: Input.Rules.Preset, overrides: Input.Rules.Overrides);
|
5
|
+
private readonly input;
|
6
|
+
constructor(input: Input.Rules.Rules);
|
8
7
|
ruleset<S extends Scope>(scope: literalful<S>): Ruleset<S>;
|
9
8
|
}
|
10
9
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/factory/rulesets/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAiB,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,OAAO;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/factory/rulesets/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAiB,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,OAAO;IACA,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK;IAE9C,OAAO,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAQlE"}
|
@@ -1,15 +1,13 @@
|
|
1
1
|
import Ruleset, { Rule } from "./ruleset/index.js";
|
2
2
|
export default class {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
this.preset = preset;
|
7
|
-
this.overrides = overrides;
|
3
|
+
input;
|
4
|
+
constructor(input) {
|
5
|
+
this.input = input;
|
8
6
|
}
|
9
7
|
ruleset(scope) {
|
10
8
|
try {
|
11
|
-
|
12
|
-
|
9
|
+
const { preset, overrides } = this.input;
|
10
|
+
return new Ruleset(scope, ...preset[scope].map(args => new Rule(...args))).override(overrides[scope]);
|
13
11
|
}
|
14
12
|
catch (e) {
|
15
13
|
throw new Error(`linted.factory.Rulesets/ruleset/scope:${scope}`, { cause: e });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/factory/rulesets/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAInD,MAAM,CAAC,OAAO;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/factory/rulesets/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAInD,MAAM,CAAC,OAAO;IACiB;IAA7B,YAA6B,KAAwB;QAAxB,UAAK,GAAL,KAAK,CAAmB;IAAG,CAAC;IAElD,OAAO,CAAkB,KAAoB;QAClD,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YAEzC,OAAO,IAAI,OAAO,CAAI,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3G,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,yCAAyC,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAAC,CAAC;IAChG,CAAC;CACF"}
|
package/dist/index.js
CHANGED
@@ -2,7 +2,7 @@ import scopes, {} from "./scopes/index.js";
|
|
2
2
|
import { Options, Files, Rulesets } from "./factory/index.js";
|
3
3
|
export default function (plugins, parsers, files, rules) {
|
4
4
|
try {
|
5
|
-
const F = new Files(files
|
5
|
+
const F = new Files(files), R = new Rulesets(rules), Pa = {
|
6
6
|
js: [],
|
7
7
|
ts: [parsers.ts],
|
8
8
|
svelte: [parsers.svelte, parsers.ts],
|
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,mBAAmB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9D,MAAM,CAAC,OAAO,WACZ,OAA+B,EAC/B,OAA+B,EAC/B,KAGC,EACD,KAGC;IAED,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO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EAAE,OAAO,CAAC,KAAK,EAAE,EACxB,EAAE,CAAC,KAAK,CACT,CAAC,OAAO;YACX,GAAG,EAAE,IAAI,OAAO;iBACb,GAAG,CACF,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EACd,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAChB,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EACpB,EAAE,CAAC,GAAG,CACP,CAAC,OAAO;YACX,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EACb,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EACf,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,EACtC,EAAE,CAAC,EAAE,CACN,CAAC,OAAO;SACZ,CAAC;QAEF,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QAAC,MAAM,IAAI,KAAK,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAAC,CAAC;AAC7D,CAAC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"_schemaVersion": "20.15.0",
|
3
3
|
"name": "@eslinted/core",
|
4
|
-
"version": "3.1.
|
4
|
+
"version": "3.1.3",
|
5
5
|
"description": "Core ESLint flat config factory npm package `linted`.",
|
6
6
|
"keywords": [],
|
7
7
|
"license": "MIT",
|
@@ -26,7 +26,7 @@
|
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
28
|
"eslint": "~9.9.0",
|
29
|
-
"linted": "~16.2.
|
29
|
+
"linted": "~16.2.1",
|
30
30
|
"npm-run-all": "^4.1.5",
|
31
31
|
"typescript": "^5.5.4"
|
32
32
|
},
|
@@ -1,4 +1,11 @@
|
|
1
1
|
import type Preset from "./preset/index.js";
|
2
2
|
import type Overrides from "./overrides/index.js";
|
3
3
|
|
4
|
-
|
4
|
+
type Rules = { preset: Preset; overrides: Overrides };
|
5
|
+
|
6
|
+
export type {
|
7
|
+
Preset,
|
8
|
+
Overrides,
|
9
|
+
Rules,
|
10
|
+
Rules as default,
|
11
|
+
};
|
@@ -2,14 +2,13 @@ import type { Scope } from "../../scopes/index.js";
|
|
2
2
|
import type { Input } from "../../boundary/index.js";
|
3
3
|
|
4
4
|
export default class Files {
|
5
|
-
constructor(
|
6
|
-
private readonly base: Input.Files.Base,
|
7
|
-
private readonly includes: Input.Files.Includes,
|
8
|
-
) {}
|
5
|
+
constructor(private readonly input: Input.Files.Files) {}
|
9
6
|
|
10
7
|
public files(scope: Scope): readonly string[] {
|
11
8
|
try {
|
12
|
-
|
9
|
+
const { base, includes } = this.input;
|
10
|
+
|
11
|
+
return [...base[scope], ...includes[scope] ?? []];
|
13
12
|
}
|
14
13
|
catch (e) { throw new Error(`linted.factory.Files/scope:${scope}`, { cause: e }); }
|
15
14
|
}
|
@@ -3,15 +3,13 @@ import type { Input } from "../../boundary/index.js";
|
|
3
3
|
import type { Scope } from "../../scopes/index.js";
|
4
4
|
|
5
5
|
export default class {
|
6
|
-
constructor(
|
7
|
-
private readonly preset: Input.Rules.Preset,
|
8
|
-
private readonly overrides: Input.Rules.Overrides,
|
9
|
-
) {}
|
6
|
+
constructor(private readonly input: Input.Rules.Rules) {}
|
10
7
|
|
11
8
|
public ruleset<S extends Scope>(scope: literalful<S>): Ruleset<S> {
|
12
9
|
try {
|
13
|
-
|
14
|
-
|
10
|
+
const { preset, overrides } = this.input;
|
11
|
+
|
12
|
+
return new Ruleset<S>(scope, ...preset[scope].map(args => new Rule(...args))).override(overrides[scope]);
|
15
13
|
}
|
16
14
|
catch (e) { throw new Error(`linted.factory.Rulesets/ruleset/scope:${scope}`, { cause: e }); }
|
17
15
|
}
|
package/src/index.ts
CHANGED
@@ -16,8 +16,8 @@ export default function (
|
|
16
16
|
},
|
17
17
|
): Boundary.Output[] {
|
18
18
|
try {
|
19
|
-
const F = new Files(files
|
20
|
-
R = new Rulesets(rules
|
19
|
+
const F = new Files(files),
|
20
|
+
R = new Rulesets(rules),
|
21
21
|
Pa: { [S in Scope]: ConstructorParameters<typeof Options[S]>[3] } = {
|
22
22
|
js: [] as const,
|
23
23
|
ts: [parsers.ts] as const,
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import type { Scope } from "../../scopes/index.js";
|
2
|
-
import Rule from "./rule/index.js";
|
3
|
-
export { Rule };
|
4
|
-
export default class Ruleset<S extends Scope> {
|
5
|
-
private readonly scope;
|
6
|
-
readonly ruleset: readonly Rule[];
|
7
|
-
overrides: Null<Rule>;
|
8
|
-
constructor(scope: literalful<S>, ...rules: readonly Rule[]);
|
9
|
-
get id(): literalful<S>;
|
10
|
-
get records(): (readonly [string, Readonly<Record<string, import("../../boundary/input/rules/preset/entry/object/state/index.js").Level | readonly [import("../../boundary/input/rules/preset/entry/object/state/index.js").Level, ...unknown[]]>>])[];
|
11
|
-
override(overrides: undefined | Rule["rules"]): this;
|
12
|
-
}
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/factory/ruleset/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,IAAI,MAAM,iBAAiB,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,CAAC,SAAS,KAAK;IAI9B,OAAO,CAAC,QAAQ,CAAC,KAAK;IAHlC,SAAgB,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;IAClC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAQ;gBAEP,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,SAAS,IAAI,EAAE;IAO5E,IAAW,EAAE,kBAIZ;IAED,IAAW,OAAO,4OAUjB;IAEM,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC;CAMrD"}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import Rule from "./rule/index.js";
|
2
|
-
export { Rule };
|
3
|
-
export default class Ruleset {
|
4
|
-
scope;
|
5
|
-
ruleset;
|
6
|
-
overrides = null;
|
7
|
-
constructor(scope, ...rules) {
|
8
|
-
this.scope = scope;
|
9
|
-
try {
|
10
|
-
this.ruleset = [...rules];
|
11
|
-
}
|
12
|
-
catch (e) {
|
13
|
-
throw new Error(`linted.factory.Ruleset`, { cause: e });
|
14
|
-
}
|
15
|
-
}
|
16
|
-
get id() {
|
17
|
-
const { scope } = this;
|
18
|
-
return scope;
|
19
|
-
}
|
20
|
-
get records() {
|
21
|
-
try {
|
22
|
-
const { ruleset, overrides } = this;
|
23
|
-
return [
|
24
|
-
...ruleset.map(rules => [rules.id, rules.rules]),
|
25
|
-
...overrides === null ? [] : [[overrides.id, overrides.rules]],
|
26
|
-
];
|
27
|
-
}
|
28
|
-
catch (e) {
|
29
|
-
throw new Error(`linted.factory.Ruleset: records`, { cause: e });
|
30
|
-
}
|
31
|
-
}
|
32
|
-
override(overrides) {
|
33
|
-
if (typeof overrides !== "undefined")
|
34
|
-
this.overrides = new Rule("override", overrides);
|
35
|
-
return this;
|
36
|
-
}
|
37
|
-
}
|
38
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/factory/ruleset/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,iBAAiB,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO;IAIG;IAHb,OAAO,CAAkB;IAClC,SAAS,GAAe,IAAI,CAAC;IAEpC,YAA6B,KAAoB,EAAE,G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,MAAM,4BAA4B,CAAC;AAExD,MAAM,CAAC,OAAO;aAEM,EAAE,EAAE,MAAM;aACV,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM;gBADtC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM;CAEzD"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/factory/ruleset/rule/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO;IAEM;IACA;IAFlB,YACkB,EAAU,EACV,KAAsC;QADtC,OAAE,GAAF,EAAE,CAAQ;QACV,UAAK,GAAL,KAAK,CAAiC;IACrD,CAAC;CACL"}
|