@eslinted/core 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { default as Ruleset } from "./ruleset/Ruleset.js";
7
7
  export { Rule } from "./ruleset/Ruleset.js";
8
8
  export type { Scopes } from "./scopes.js";
9
9
  export type { default as IConfig } from "./interface/IConfig.js";
10
- export default function (plugins: Plugins, parsers: Parsers, files: Record<"defaults" | "includes", Record<Scopes, string[]>>, rulesets: {
10
+ export default function (plugins: Plugins, parsers: Parsers, defaults: Record<Scopes, string[]>, includes: Partial<Record<Scopes, string[]>>, rulesets: {
11
11
  [S in Scopes]: Ruleset<S>;
12
12
  }): IConfig[];
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjE,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,CACT,UAAU,GACV,UAAU,EAEZ,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CACzB,EACD,QAAQ,EAAE;KAAG,CAAC,IAAI,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAAE,GACtC,OAAO,EAAE,CAyFX"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjE,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAClC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,EAC3C,QAAQ,EAAE;KAAG,CAAC,IAAI,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAAE,GACtC,OAAO,EAAE,CAyFX"}
package/dist/index.js CHANGED
@@ -2,29 +2,29 @@ import scopes from "./scopes.js";
2
2
  import options from "./options.js";
3
3
  export { default as Ruleset } from "./ruleset/Ruleset.js";
4
4
  export { Rule } from "./ruleset/Ruleset.js";
5
- export default function (plugins, parsers, files, rulesets) {
5
+ export default function (plugins, parsers, defaults, includes, rulesets) {
6
6
  try {
7
7
  const instantiatedOptions = {
8
8
  js: new options
9
- .js(plugins.js, ...files.defaults.js, ...files.includes.js)
9
+ .js(plugins.js, ...defaults.js, ...includes.js ?? [])
10
10
  .body,
11
11
  ts: new options
12
- .ts(plugins.ts, parsers.ts, ...files.defaults.ts, ...files.includes.ts)
12
+ .ts(plugins.ts, parsers.ts, ...defaults.ts, ...includes.ts ?? [])
13
13
  .body,
14
14
  svelte: new options
15
- .svelte(plugins.svelte, parsers.svelte, parsers.ts, ...files.defaults.svelte, ...files.includes.svelte)
15
+ .svelte(plugins.svelte, parsers.svelte, parsers.ts, ...defaults.svelte, ...includes.svelte ?? [])
16
16
  .body,
17
17
  html: new options
18
- .html(plugins.html, parsers.html, ...files.defaults.html, ...files.includes.html)
18
+ .html(plugins.html, parsers.html, ...defaults.html, ...includes.html ?? [])
19
19
  .body,
20
20
  json: new options
21
- .json(plugins.json, parsers.json, ...files.defaults.json, ...files.includes.json)
21
+ .json(plugins.json, parsers.json, ...defaults.json, ...includes.json ?? [])
22
22
  .body,
23
23
  jsonc: new options
24
- .jsonc(plugins.jsonc, parsers.jsonc, ...files.defaults.jsonc, ...files.includes.jsonc)
24
+ .jsonc(plugins.jsonc, parsers.jsonc, ...defaults.jsonc, ...includes.jsonc ?? [])
25
25
  .body,
26
26
  yml: new options
27
- .yml(plugins.yml, parsers.yml, ...files.defaults.yml, ...files.includes.yml)
27
+ .yml(plugins.yml, parsers.yml, ...defaults.yml, ...includes.yml ?? [])
28
28
  .body,
29
29
  };
30
30
  return scopes
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AAOnC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAG5C,MAAM,CAAC,OAAO,WACZ,OAAgB,EAChB,OAAgB,EAChB,KAKC,EACD,QAAuC;IAEvC,IAAI,CAAC;QACH,MAAM,mBAAmB,GAIrB;YACF,EAAE,EAAE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EAAE;gBACN,OAAO;oBACL,KAAK;oBACL,GAAG,mBAAmB,CAAC,KAAK,CAAC;iBAC9B,CAAC;YACJ,CAAC,CACF;YACH,CAAC,CAAC,EAAE,CACT;aACA,IAAI,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,6BAA6B,EAC7B,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.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -13,12 +13,8 @@ export type { default as IConfig } from "./interface/IConfig.js";
13
13
  export default function (
14
14
  plugins: Plugins,
15
15
  parsers: Parsers,
16
- files: Record<
17
- | "defaults"
18
- | "includes"
19
- ,
20
- Record<Scopes, string[]>
21
- >,
16
+ defaults: Record<Scopes, string[]>,
17
+ includes: Partial<Record<Scopes, string[]>>,
22
18
  rulesets: { [S in Scopes]: Ruleset<S> },
23
19
  ): IConfig[] {
24
20
  try {
@@ -30,16 +26,16 @@ export default function (
30
26
  js: new options
31
27
  .js(
32
28
  plugins.js,
33
- ...files.defaults.js,
34
- ...files.includes.js,
29
+ ...defaults.js,
30
+ ...includes.js ?? [],
35
31
  )
36
32
  .body,
37
33
  ts: new options
38
34
  .ts(
39
35
  plugins.ts,
40
36
  parsers.ts,
41
- ...files.defaults.ts,
42
- ...files.includes.ts,
37
+ ...defaults.ts,
38
+ ...includes.ts ?? [],
43
39
  )
44
40
  .body,
45
41
  svelte: new options
@@ -47,40 +43,40 @@ export default function (
47
43
  plugins.svelte,
48
44
  parsers.svelte,
49
45
  parsers.ts,
50
- ...files.defaults.svelte,
51
- ...files.includes.svelte,
46
+ ...defaults.svelte,
47
+ ...includes.svelte ?? [],
52
48
  )
53
49
  .body,
54
50
  html: new options
55
51
  .html(
56
52
  plugins.html,
57
53
  parsers.html,
58
- ...files.defaults.html,
59
- ...files.includes.html,
54
+ ...defaults.html,
55
+ ...includes.html ?? [],
60
56
  )
61
57
  .body,
62
58
  json: new options
63
59
  .json(
64
60
  plugins.json,
65
61
  parsers.json,
66
- ...files.defaults.json,
67
- ...files.includes.json,
62
+ ...defaults.json,
63
+ ...includes.json ?? [],
68
64
  )
69
65
  .body,
70
66
  jsonc: new options
71
67
  .jsonc(
72
68
  plugins.jsonc,
73
69
  parsers.jsonc,
74
- ...files.defaults.jsonc,
75
- ...files.includes.jsonc,
70
+ ...defaults.jsonc,
71
+ ...includes.jsonc ?? [],
76
72
  )
77
73
  .body,
78
74
  yml: new options
79
75
  .yml(
80
76
  plugins.yml,
81
77
  parsers.yml,
82
- ...files.defaults.yml,
83
- ...files.includes.yml,
78
+ ...defaults.yml,
79
+ ...includes.yml ?? [],
84
80
  )
85
81
  .body,
86
82
  };