@eslinted/core 0.0.1-rc.7 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +10 -30
  4. package/dist/index.js.map +1 -1
  5. package/dist/interface/IConfig.d.ts +19 -0
  6. package/dist/interface/IConfig.d.ts.map +1 -0
  7. package/dist/interface/IConfig.js +2 -0
  8. package/dist/interface/IConfig.js.map +1 -0
  9. package/package.json +1 -1
  10. package/src/index.ts +33 -51
  11. package/{interface/IConfig.d.ts → src/interface/IConfig.ts} +1 -1
  12. package/tsconfig.json +0 -1
  13. /package/{interface → src/interface}/files/IFiles.d.ts +0 -0
  14. /package/{interface → src/interface}/option/IOption.d.ts +0 -0
  15. /package/{interface → src/interface}/option/language/IOLanguage.d.ts +0 -0
  16. /package/{interface → src/interface}/option/language/ecma/IOLanguageEcma.d.ts +0 -0
  17. /package/{interface → src/interface}/option/language/globals/IOLanguageGlobals.d.ts +0 -0
  18. /package/{interface → src/interface}/option/language/parser/IOLanguageParser.d.ts +0 -0
  19. /package/{interface → src/interface}/option/language/parserOptions/IOLanguageParserOptions.d.ts +0 -0
  20. /package/{interface → src/interface}/option/language/source/IOLanguageSource.d.ts +0 -0
  21. /package/{interface → src/interface}/option/linter/IOLinter.d.ts +0 -0
  22. /package/{interface → src/interface}/option/name/IOName.d.ts +0 -0
  23. /package/{interface → src/interface}/option/plugins/IOPlugins.d.ts +0 -0
  24. /package/{interface → src/interface}/option/processor/IOProcessor.d.ts +0 -0
  25. /package/{interface → src/interface}/rules/IRules.d.ts +0 -0
  26. /package/{interface → src/interface}/rules/rule/IRule.d.ts +0 -0
  27. /package/{interface → src/interface}/rules/rule/state/RuleSeverity.d.ts +0 -0
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
+ import type IConfig from "./interface/IConfig.js";
1
2
  import type { Scopes } from "./scopes.js";
2
3
  import type Plugins from "./plugins.js";
3
4
  import type Parsers from "./parsers.js";
4
5
  import type Ruleset from "./ruleset/Ruleset.js";
5
6
  export { default as Ruleset } from "./ruleset/Ruleset.js";
6
7
  export { Rule } from "./ruleset/Ruleset.js";
7
- export { default as scopes } from "./scopes.js";
8
8
  export type { Scopes } from "./scopes.js";
9
+ export type { default as IConfig } from "./interface/IConfig.js";
9
10
  export default function (plugins: Plugins, parsers: Parsers, files: Record<Scopes, string[]>, rulesets: {
10
11
  [S in Scopes]: Ruleset<S>;
11
12
  }): IConfig[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,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,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAC/B,QAAQ,EAAE;KAAG,CAAC,IAAI,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAAE,GACtC,OAAO,EAAE,CAqGX"}
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,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAC/B,QAAQ,EAAE;KAAG,CAAC,IAAI,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAAE,GACtC,OAAO,EAAE,CAkFX"}
package/dist/index.js CHANGED
@@ -2,56 +2,36 @@ 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 as scopes } from "./scopes.js";
6
5
  export default function (plugins, parsers, files, rulesets) {
7
6
  try {
8
7
  const instantiatedOptions = {
9
8
  js: new options
10
- .js(plugins
11
- .js, ...files
12
- .js)
9
+ .js(plugins.js, ...files.js)
13
10
  .body,
14
11
  ts: new options
15
- .ts(plugins
16
- .ts, parsers
17
- .ts, ...files
18
- .ts)
12
+ .ts(plugins.ts, parsers.ts, ...files.ts)
19
13
  .body,
20
14
  svelte: new options
21
- .svelte(plugins
22
- .svelte, parsers
23
- .svelte, parsers
24
- .ts, ...files
25
- .svelte)
15
+ .svelte(plugins.svelte, parsers.svelte, parsers.ts, ...files.svelte)
26
16
  .body,
27
17
  html: new options
28
- .html(plugins
29
- .html, parsers
30
- .html, ...files
31
- .html)
18
+ .html(plugins.html, parsers.html, ...files.html)
32
19
  .body,
33
20
  json: new options
34
- .json(plugins
35
- .json, parsers
36
- .json, ...files
37
- .json)
21
+ .json(plugins.json, parsers.json, ...files.json)
38
22
  .body,
39
23
  jsonc: new options
40
- .jsonc(plugins
41
- .jsonc, parsers
42
- .jsonc, ...files
43
- .jsonc)
24
+ .jsonc(plugins.jsonc, parsers.jsonc, ...files.jsonc)
44
25
  .body,
45
26
  yml: new options
46
- .yml(plugins
47
- .yml, parsers
48
- .yml, ...files
49
- .yml)
27
+ .yml(plugins.yml, parsers.yml, ...files.yml)
50
28
  .body,
51
29
  };
52
30
  return scopes
53
31
  .map(scope => instantiatedOptions[scope].files.length > 0
54
- ? rulesets[scope].flat.map(rules => {
32
+ ? rulesets[scope]
33
+ .flat
34
+ .map(rules => {
55
35
  return {
56
36
  rules,
57
37
  ...instantiatedOptions[scope],
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;AAMnC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,CAAC,OAAO,WACZ,OAAgB,EAChB,OAAgB,EAChB,KAA+B,EAC/B,QAAuC;IAEvC,IAAI,CAAC;QACH,MAAM,mBAAmB,GAIrB;YACF,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,OAAO;iBACJ,EAAE,EACL,GAAG,KAAK;iBACL,EAAE,CACN;iBACA,IAAI;YACP,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,OAAO;iBACJ,EAAE,EACL,OAAO;iBACJ,EAAE,EACL,GAAG,KAAK;iBACL,EAAE,CACN;iBACA,IAAI;YACP,MAAM,EA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,GAAG,EACX,GAAG,KAAK,CAAC,GAAG,CACb;iBACA,IAAI;SACR,CAAC;QAEF,OAAO,MAAM;aACV,GAAG,CACF,KAAK,CAAC,EAAE,CACN,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YACzC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;iBACd,IAAI;iBACJ,GAAG,CACF,KAAK,CAAC,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"}
@@ -0,0 +1,19 @@
1
+ export default interface IConfig {
2
+ rules: IRule;
3
+ files: string[];
4
+ name: `linted/scope:${string}`;
5
+ linterOptions: {
6
+ noInlineConfig: true;
7
+ reportUnusedDisableDirectives: "error";
8
+ };
9
+ languageOptions: {
10
+ sourceType?: "module" | "script";
11
+ ecmaVersion?: "latest";
12
+ globals?: Record<string, true>;
13
+ parser?: unknown;
14
+ parserOptions?: Record<string, unknown>;
15
+ };
16
+ plugins: Record<string, Record<"configs", unknown>>;
17
+ processor?: string;
18
+ }
19
+ //# sourceMappingURL=IConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConfig.d.ts","sourceRoot":"","sources":["../../src/interface/IConfig.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,OAAO;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,gBAAgB,MAAM,EAAE,CAAC;IAC/B,aAAa,EAAE;QACb,cAAc,EAAE,IAAI,CAAC;QACrB,6BAA6B,EAAE,OAAO,CAAC;KACxC,CAAC;IACF,eAAe,EAAE;QACf,UAAU,CAAC,EACP,QAAQ,GACR,QAAQ,CACX;QACD,WAAW,CAAC,EAAE,QAAQ,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACzC,CAAC;IACF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConfig.js","sourceRoot":"","sources":["../../src/interface/IConfig.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslinted/core",
3
- "version": "0.0.1-rc.7",
3
+ "version": "0.0.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import scopes from "./scopes.js";
2
2
  import options from "./options.js";
3
+ import type IConfig from "./interface/IConfig.js";
3
4
  import type { Scopes } from "./scopes.js";
4
5
  import type Plugins from "./plugins.js";
5
6
  import type Parsers from "./parsers.js";
@@ -7,8 +8,8 @@ import type Ruleset from "./ruleset/Ruleset.js";
7
8
 
8
9
  export { default as Ruleset } from "./ruleset/Ruleset.js";
9
10
  export { Rule } from "./ruleset/Ruleset.js";
10
- export { default as scopes } from "./scopes.js";
11
11
  export type { Scopes } from "./scopes.js";
12
+ export type { default as IConfig } from "./interface/IConfig.js";
12
13
  export default function (
13
14
  plugins: Plugins,
14
15
  parsers: Parsers,
@@ -23,72 +24,51 @@ export default function (
23
24
  } = {
24
25
  js: new options
25
26
  .js(
26
- plugins
27
- .js,
28
- ...files
29
- .js,
27
+ plugins.js,
28
+ ...files.js,
30
29
  )
31
30
  .body,
32
31
  ts: new options
33
32
  .ts(
34
- plugins
35
- .ts,
36
- parsers
37
- .ts,
38
- ...files
39
- .ts,
33
+ plugins.ts,
34
+ parsers.ts,
35
+ ...files.ts,
40
36
  )
41
37
  .body,
42
38
  svelte: new options
43
39
  .svelte(
44
- plugins
45
- .svelte,
46
- parsers
47
- .svelte,
48
- parsers
49
- .ts,
50
- ...files
51
- .svelte,
40
+ plugins.svelte,
41
+ parsers.svelte,
42
+ parsers.ts,
43
+ ...files.svelte,
52
44
  )
53
45
  .body,
54
46
  html: new options
55
47
  .html(
56
- plugins
57
- .html,
58
- parsers
59
- .html,
60
- ...files
61
- .html,
48
+ plugins.html,
49
+ parsers.html,
50
+ ...files.html,
62
51
  )
63
52
  .body,
64
53
  json: new options
65
54
  .json(
66
- plugins
67
- .json,
68
- parsers
69
- .json,
70
- ...files
71
- .json,
55
+ plugins.json,
56
+ parsers.json,
57
+ ...files.json,
72
58
  )
73
59
  .body,
74
60
  jsonc: new options
75
61
  .jsonc(
76
- plugins
77
- .jsonc,
78
- parsers
79
- .jsonc,
80
- ...files
81
- .jsonc,
62
+ plugins.jsonc,
63
+ parsers.jsonc,
64
+ ...files.jsonc,
82
65
  )
83
66
  .body,
84
67
  yml: new options
85
68
  .yml(
86
- plugins
87
- .yml,
88
- parsers
89
- .yml,
90
- ...files
91
- .yml,
69
+ plugins.yml,
70
+ parsers.yml,
71
+ ...files.yml,
92
72
  )
93
73
  .body,
94
74
  };
@@ -97,14 +77,16 @@ export default function (
97
77
  .map(
98
78
  scope =>
99
79
  instantiatedOptions[scope].files.length > 0
100
- ? rulesets[scope].flat.map(
101
- rules => {
102
- return {
103
- rules,
104
- ...instantiatedOptions[scope],
105
- };
106
- },
107
- )
80
+ ? rulesets[scope]
81
+ .flat
82
+ .map(
83
+ rules => {
84
+ return {
85
+ rules,
86
+ ...instantiatedOptions[scope],
87
+ };
88
+ },
89
+ )
108
90
  : [],
109
91
  )
110
92
  .flat();
@@ -1,4 +1,4 @@
1
- declare interface IConfig {
1
+ export default interface IConfig {
2
2
  rules: IRule;
3
3
  files: string[];
4
4
  name: `linted/scope:${string}`;
package/tsconfig.json CHANGED
@@ -5,7 +5,6 @@
5
5
  "include": [
6
6
  "*.config.ts",
7
7
  "src/**/*.ts",
8
- "interface/**/*.d.ts",
9
8
  "types/**/*.d.ts",
10
9
  ],
11
10
  "compilerOptions": {
File without changes
File without changes