@eslinted/core 19.0.3-rc.1 → 19.0.3-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/factory/index.d.ts +3250 -5
  2. package/dist/factory/index.d.ts.map +1 -1
  3. package/dist/factory/index.js +38 -30
  4. package/dist/factory/index.js.map +1 -1
  5. package/dist/scope/registry/index.d.ts +6 -27
  6. package/dist/scope/registry/index.d.ts.map +1 -1
  7. package/dist/scope/registry/manifests/css.js +4 -4
  8. package/dist/scope/registry/manifests/css.js.map +1 -1
  9. package/dist/scope/registry/manifests/html.d.ts.map +1 -1
  10. package/dist/scope/registry/manifests/html.js +2 -1
  11. package/dist/scope/registry/manifests/html.js.map +1 -1
  12. package/dist/scope/registry/manifests/js.d.ts.map +1 -1
  13. package/dist/scope/registry/manifests/js.js +6 -2
  14. package/dist/scope/registry/manifests/js.js.map +1 -1
  15. package/dist/scope/registry/manifests/json.js +2 -2
  16. package/dist/scope/registry/manifests/json.js.map +1 -1
  17. package/dist/scope/registry/manifests/jsonc.d.ts.map +1 -1
  18. package/dist/scope/registry/manifests/jsonc.js +6 -2
  19. package/dist/scope/registry/manifests/jsonc.js.map +1 -1
  20. package/dist/scope/registry/manifests/jsoncc.d.ts.map +1 -1
  21. package/dist/scope/registry/manifests/jsoncc.js +6 -2
  22. package/dist/scope/registry/manifests/jsoncc.js.map +1 -1
  23. package/dist/scope/registry/manifests/mocha.d.ts +1 -11
  24. package/dist/scope/registry/manifests/mocha.d.ts.map +1 -1
  25. package/dist/scope/registry/manifests/mocha.js +1 -11
  26. package/dist/scope/registry/manifests/mocha.js.map +1 -1
  27. package/dist/scope/registry/manifests/svelte.d.ts +0 -9
  28. package/dist/scope/registry/manifests/svelte.d.ts.map +1 -1
  29. package/dist/scope/registry/manifests/svelte.js +0 -10
  30. package/dist/scope/registry/manifests/svelte.js.map +1 -1
  31. package/dist/scope/registry/manifests/ts.d.ts +4 -4
  32. package/dist/scope/registry/manifests/ts.d.ts.map +1 -1
  33. package/dist/scope/registry/manifests/ts.js +19 -9
  34. package/dist/scope/registry/manifests/ts.js.map +1 -1
  35. package/dist/scope/registry/manifests/yml.d.ts +1 -3
  36. package/dist/scope/registry/manifests/yml.d.ts.map +1 -1
  37. package/dist/scope/registry/manifests/yml.js +2 -2
  38. package/dist/scope/registry/manifests/yml.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/factory/index.ts +42 -31
  41. package/src/interface/output/configs/scoped/settings.d.ts +1 -1
  42. package/src/scope/registry/manifests/css.ts +4 -4
  43. package/src/scope/registry/manifests/html.ts +2 -1
  44. package/src/scope/registry/manifests/js.ts +6 -2
  45. package/src/scope/registry/manifests/json.ts +2 -2
  46. package/src/scope/registry/manifests/jsonc.ts +6 -2
  47. package/src/scope/registry/manifests/jsoncc.ts +6 -2
  48. package/src/scope/registry/manifests/mocha.ts +1 -11
  49. package/src/scope/registry/manifests/svelte.ts +0 -10
  50. package/src/scope/registry/manifests/ts.ts +20 -9
  51. package/src/scope/registry/manifests/yml.ts +1 -1
@@ -163,19 +163,25 @@ export class Factory<
163
163
  languageOptions: {
164
164
  parser = null,
165
165
  globals: global = null,
166
- ...languageOptionsStatic
166
+ ...extraLanguageOptions
167
167
  },
168
168
  parserOptions: {
169
169
  parser: subparser = null,
170
- ...parserOptionsStatic
170
+ ...extraParserOptions
171
171
  },
172
172
  processor = null,
173
173
  language = null,
174
174
  } = this.registry[scope];
175
175
 
176
+ function isGlobal(
177
+ global: string,
178
+ ): global is keyof typeof globals {
179
+ return global in globals;
180
+ }
181
+
176
182
  if (
177
183
  global !== null
178
- && !(global in globals)
184
+ && !isGlobal(global)
179
185
  )
180
186
  throw new ReferenceError(
181
187
  "Global does not exist",
@@ -191,36 +197,41 @@ export class Factory<
191
197
  name: `linted/${scope as string}/` as const,
192
198
  files,
193
199
  ignores,
194
- languageOptions: {
195
- ...languageOptionsStatic,
196
- ...global === null
197
- ? {}
198
- : {
199
- globals: globals[global as keyof typeof globals] as Record<string, boolean>,
200
- },
201
- ...parser === null
202
- ? {}
203
- : {
204
- parser: this
205
- .parsers[parser],
206
- },
207
- ...Object
208
- .keys(parserOptionsStatic)
209
- .length < 1
210
- && subparser === null
211
- ? {}
212
- : {
213
- parserOptions: {
214
- ...parserOptionsStatic,
215
- ...subparser === null
216
- ? {}
217
- : {
218
- parser: this
219
- .parsers[subparser],
200
+ ...parser === null
201
+ && global === null
202
+ && subparser === null
203
+ && [...Object.keys(extraLanguageOptions)].length === 0
204
+ && [...Object.keys(extraParserOptions)].length === 0
205
+ ? {}
206
+ : {
207
+ languageOptions: {
208
+ ...extraLanguageOptions,
209
+ ...global === null
210
+ ? {}
211
+ : {
212
+ globals: globals[global],
213
+ },
214
+ ...parser === null
215
+ ? {}
216
+ : {
217
+ parser: this.parsers[parser],
218
+ },
219
+ ...subparser === null
220
+ && [...Object.keys(extraParserOptions)].length === 0
221
+ ? {}
222
+ : {
223
+ parserOptions: {
224
+ ...extraParserOptions,
225
+ ...subparser === null
226
+ ? {}
227
+ : {
228
+ parser: this
229
+ .parsers[subparser],
230
+ },
220
231
  },
221
- },
232
+ },
222
233
  },
223
- },
234
+ },
224
235
  ...processor === null
225
236
  ? {}
226
237
  : { processor },
@@ -2,7 +2,7 @@ import type { Config } from "../../../config";
2
2
 
3
3
  export type Settings = {
4
4
  name: `linted/${string}`;
5
- languageOptions: object;
5
+ languageOptions?: object;
6
6
  } & Pick<
7
7
  Config,
8
8
  | "files"
@@ -1,9 +1,9 @@
1
1
  export const css = {
2
2
  languageOptions: {
3
- tolerant: false,
4
- },
5
- parserOptions: {
6
- // DOC: https://github.com/ota-meshi/yaml-eslint-parser?tab=readme-ov-file#advanced-configuration
3
+ // DOC: https://github.com/eslint/css?tab=readme-ov-file#languages
4
+ tolerant: false /* @default: true | DOC: https://github.com/eslint/css?tab=readme-ov-file#tolerant-mode */,
5
+ // customSyntax: {} /* DOC: Tailwind: https://github.com/eslint/css?tab=readme-ov-file#configuring-tailwind-syntax | DOC: https://github.com/eslint/css?tab=readme-ov-file#configuring-custom-syntax */,
7
6
  },
7
+ parserOptions: {},
8
8
  language: "css/css",
9
9
  };
@@ -3,7 +3,8 @@ export const html = {
3
3
  parser: "html" as const,
4
4
  },
5
5
  parserOptions: {
6
- frontmatter: true /* DOC: https://github.com/yeonjuan/html-eslint/issues/291#issuecomment-2726307803 */,
6
+ // templateEngineSyntax: {} /* DOC: https://html-eslint.org/docs/integrating-template-engine */,
7
+ frontmatter: true /* @default: false | DOC: https://html-eslint.org/docs/integrating-template-engine#skip-frontmatter */,
7
8
  },
8
9
  language: "@html-eslint/html",
9
10
  };
@@ -1,4 +1,8 @@
1
1
  export const js = {
2
- languageOptions: {},
3
- parserOptions: {},
2
+ languageOptions: {
3
+ // DOC: https://eslint.org/docs/latest/use/configure/language-options
4
+ },
5
+ parserOptions: {
6
+ // DOC: https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options
7
+ },
4
8
  };
@@ -1,7 +1,7 @@
1
1
  export const json = {
2
2
  languageOptions: {
3
- allowTrailingCommas: true,
3
+ allowTrailingCommas: true /* DOC: https://github.com/eslint/json?tab=readme-ov-file#allowing-trailing-commas-in-jsonc */,
4
4
  },
5
5
  parserOptions: {},
6
- language: "json/jsonc",
6
+ language: "json/jsonc" /* INFO: `languageOptions.allowTrailingCommas` is only available on language `json/jsonc` */,
7
7
  };
@@ -1,5 +1,9 @@
1
1
  export const jsonc = {
2
- languageOptions: {},
3
- parserOptions: {},
2
+ languageOptions: {
3
+ // Inherits `json`
4
+ },
5
+ parserOptions: {
6
+ // Inherits `json`
7
+ },
4
8
  language: "json/jsonc",
5
9
  };
@@ -1,5 +1,9 @@
1
1
  export const jsoncc = {
2
- languageOptions: {},
3
- parserOptions: {},
2
+ languageOptions: {
3
+ // Inherits `jsonc`
4
+ },
5
+ parserOptions: {
6
+ // Inherits `jsonc`
7
+ },
4
8
  language: "json/jsonc",
5
9
  };
@@ -3,16 +3,6 @@ export const mocha = {
3
3
  globals: "mocha" as const,
4
4
  },
5
5
  parserOptions: {
6
- // MUST BE IDENTICAL TO TS PARSER OPTIONS (eventually see if can inherit)
7
- ecmaFeatures: {
8
- jsx: false,
9
- globalReturn: true,
10
- },
11
- jsDocParsingMode: "none" /* @default(project): "all" | @default: "none" | "type-info" */,
12
- projectService: true /* DOC: https://typescript-eslint.io/packages/parser/#projectservice , DOC: https://typescript-eslint.io/troubleshooting/typed-linting/#project-service-issues */,
13
- // tsconfigRootDir: import.meta.dirname /* DOC: https://typescript-eslint.io/packages/parser/#tsconfigrootdir ; see `DOC:(USE-CASE), I am inferring that an aboslute path is needed ; DOC:(Node.js: import.meta): https://nodejs.org/api/esm.html#importmetadirname */,
14
- warnOnUnsupportedTypeScriptVersion: false,
15
- sourceType: "module",
16
- ecmaVersion: 2023,
6
+ // Inherits `ts`
17
7
  },
18
8
  };
@@ -5,16 +5,6 @@ export const svelte = {
5
5
  parserOptions: {
6
6
  parser: "ts" as const,
7
7
  extraFileExtensions: [".svelte"],
8
- ecmaFeatures: {
9
- jsx: false,
10
- globalReturn: true,
11
- },
12
- jsDocParsingMode: "none" /* @default(project): "all" | @default: "none" | "type-info" */,
13
- projectService: true /* DOC: https://typescript-eslint.io/packages/parser/#projectservice , DOC: https://typescript-eslint.io/troubleshooting/typed-linting/#project-service-issues */,
14
- // tsconfigRootDir: import.meta.dirname /* DOC: https://typescript-eslint.io/packages/parser/#tsconfigrootdir ; see `DOC:(USE-CASE), I am inferring that an aboslute path is needed ; DOC:(Node.js: import.meta): https://nodejs.org/api/esm.html#importmetadirname */,
15
- warnOnUnsupportedTypeScriptVersion: false,
16
- sourceType: "module",
17
- ecmaVersion: 2023,
18
8
  },
19
9
  processor: "svelte/svelte",
20
10
  };
@@ -4,16 +4,27 @@ export const ts = {
4
4
  },
5
5
  parserOptions: {
6
6
  // DOC: https://typescript-eslint.io/packages/parser/#configuration
7
- // DOC:(USE-CASE): https://typescript-eslint.io/getting-started/typed-linting/
7
+ // INFO: `parserOptions.projectService` is the modern replacement for the deprecated `parserOptions.project`:
8
+ // - https://typescript-eslint.io/blog/project-service/
9
+ // - https://typescript-eslint.io/getting-started/typed-linting/
10
+ // - https://typescript-eslint.io/troubleshooting/typed-linting/
11
+
12
+ // disallowAutomaticSingleRunInference: false /* @default: false */,
13
+ // cacheLifetime: { glob: 30 } /* { glob: "Infinity" (never) | number | @default: 30 seconds } */,
8
14
  ecmaFeatures: {
9
- jsx: false,
10
- globalReturn: true,
15
+ // jsx: false /* @default: false */,
16
+ globalReturn: true /* @default: false */,
11
17
  },
12
- jsDocParsingMode: "none" /* @default(project): "all" | @default: "none" | "type-info" */,
13
- projectService: true /* DOC: https://typescript-eslint.io/packages/parser/#projectservice , DOC: https://typescript-eslint.io/troubleshooting/typed-linting/#project-service-issues */,
14
- // tsconfigRootDir: import.meta.dirname /* DOC: https://typescript-eslint.io/packages/parser/#tsconfigrootdir ; see `DOC:(USE-CASE), I am inferring that an aboslute path is needed ; DOC:(Node.js: import.meta): https://nodejs.org/api/esm.html#importmetadirname */,
15
- warnOnUnsupportedTypeScriptVersion: false,
16
- sourceType: "module",
17
- ecmaVersion: 2023,
18
+ ecmaVersion: 2023 /* number | @default: latest" */,
19
+ emitDecoratorMetadata: false /* boolean | @default: undefined (inherits tsconfig, which has @default: false) */,
20
+ experimentalDecorators: false /* boolean | @default: undefined (inherits tsconfig, which has @default: false) */,
21
+ // extraFileExtensions: [] /* string[] | @default: [] (none) | BUG: https://typescript-eslint.io/troubleshooting/typed-linting/performance/#changes-to-extrafileextensions-with-projectservice */,
22
+ isolatedDeclarations: false /* boolean | @default: undefined (inherits tsconfig, which has @default: false) */,
23
+ // jsDocParsingMode: "all" /* type-info | @default(if `parserOptions.project` is set): all | @default: none */,
24
+ // jsxFragmentName: null /* string | @default: null | INFO: if `parserOptions.project` is set, this will automatically be detected from the compiler. */,
25
+ // jsxPragma: "React" /* null | string (e.g. "preact") | @default: "React" | INFO: if `parserOptions.project` is set, this will automatically be detected from the compiler. */,
26
+ // lib: ["es2018"] /* string[] | @default: ["es2018"] | INFO: if `parserOptions.project` is set, this will automatically be detected from the compiler. */,
27
+ projectService: true /* ProjectServiceOptions (DOC: https://typescript-eslint.io/packages/parser/#projectserviceoptions) | true | @default: false */,
28
+ warnOnUnsupportedTypeScriptVersion: false /* preference due to nuisance | @default: true */,
18
29
  },
19
30
  };
@@ -4,6 +4,6 @@ export const yml = {
4
4
  },
5
5
  parserOptions: {
6
6
  // DOC: https://github.com/ota-meshi/yaml-eslint-parser?tab=readme-ov-file#advanced-configuration
7
- defaultYAMLVersion: "1.2" /* @default: "1.2" | "1.1" */,
7
+ // defaultYAMLVersion: "1.2" /* "1.1" | @default: "1.2" | DOC: https://github.com/ota-meshi/yaml-eslint-parser?tab=readme-ov-file#parseroptionsdefaultyamlversion */,
8
8
  },
9
9
  };