@eslinted/core 0.9.0-rc.6 → 0.9.0-rc.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -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>, ...ruleset: readonly Rule[]);
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,OAAO,EAAE,SAAS,IAAI,EAAE;IAa7B,IAAW,EAAE,kBAYZ;IAED,IAAW,OAAO,iCAejB;IAEM,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,KAAK;CAiB7C"}
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, ...ruleset) {
7
+ constructor(scope, ...rules) {
8
8
  this.scope = scope;
9
9
  try {
10
- this.ruleset = [...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,OAAwB;QADV,UAAK,GAAL,KAAK,CAAe;QAGrC,IAAI,CAAC;YACH,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;QAC9B,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,K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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
- import { Ruleset, Rule } from "./factory/factory.js";
5
- export type { Scope, Output };
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 [string, IRule][]>, overrides: Particord<Scope, IRule>): Output[];
10
6
  //# sourceMappingURL=index.d.ts.map
@@ -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;AAC7C,OAAO,EAGL,OAAO,EACP,IAAI,EACL,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACzB,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,QAAQ,EAAE;KAAG,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC;CAAE,EACtC,SAAS,EAAE,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,GACjC,MAAM,EAAE,CA0FV"}
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,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,EAChD,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 { Ruleset, Rule };
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), imports = {
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;AAG9B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACzB,MAAM,CAAC,OAAO,WACZ,OAAsB,EACtB,OAAsB,EACtB,IAA6B,EAC7B,QAAoC,EACpC,QAAsC,EACtC,SAAkC;IAElC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,IAAI,EACJ,QAAQ,CACT,EACD,OAAO,GAEH;YACF,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAU;YAC7B,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAU;YACvC,MAAM,EAAE;gBACN,OAAO,CAAC,MAAM;gBACd,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;aACpB;YACV,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAU;YAC7C,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,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AAO;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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslinted/core",
3
- "version": "0.9.0-rc.6",
3
+ "version": "0.9.0-rc.7",
4
4
  "description": "Core ESLint flat config factory npm package `linted`.",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -8,10 +8,10 @@ export default class Ruleset<S extends Scope> {
8
8
 
9
9
  constructor(
10
10
  private readonly scope: literalful<S>,
11
- ...ruleset: readonly Rule[]
11
+ ...rules: readonly Rule[]
12
12
  ) {
13
13
  try {
14
- this.ruleset = [...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 { Scope, Output };
12
- export { Ruleset, Rule };
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
- rulesets: { [S in Scope]: Ruleset<S> },
21
+ rules: Record<Scope, readonly [string, IRule][]>,
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
  } = {