@eienjs/eslint-config 2.0.0 → 2.1.0

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 (98) hide show
  1. package/LICENSE +1 -1
  2. package/bin/index.mjs +3 -0
  3. package/dist/cli/{constants.js → constants.mjs} +3 -0
  4. package/dist/cli/{constants_generated.js → constants_generated.mjs} +7 -4
  5. package/dist/cli/index.d.mts +2 -0
  6. package/dist/cli/{index.js → index.mjs} +5 -2
  7. package/dist/cli/{run.js → run.mjs} +12 -9
  8. package/dist/cli/stages/{update_eslint_files.js → update_eslint_files.mjs} +4 -1
  9. package/dist/cli/stages/{update_package_json.js → update_package_json.mjs} +15 -13
  10. package/dist/cli/stages/{update_vscode_settings.js → update_vscode_settings.mjs} +5 -2
  11. package/dist/cli/{utils.js → utils.mjs} +3 -0
  12. package/dist/config_presets.d.mts +9 -0
  13. package/dist/{config_presets.js → config_presets.mjs} +3 -0
  14. package/dist/configs/adonisjs.d.mts +8 -0
  15. package/dist/configs/{adonisjs.js → adonisjs.mjs} +27 -24
  16. package/dist/configs/{astro.d.ts → astro.d.mts} +3 -1
  17. package/dist/configs/{astro.js → astro.mjs} +6 -3
  18. package/dist/configs/command.d.mts +8 -0
  19. package/dist/configs/{command.js → command.mjs} +3 -0
  20. package/dist/configs/comments.d.mts +8 -0
  21. package/dist/configs/{comments.js → comments.mjs} +4 -1
  22. package/dist/configs/disables.d.mts +8 -0
  23. package/dist/configs/{disables.js → disables.mjs} +4 -1
  24. package/dist/configs/e18e.d.mts +8 -0
  25. package/dist/configs/{e18e.js → e18e.mjs} +7 -4
  26. package/dist/configs/{formatters.d.ts → formatters.d.mts} +3 -1
  27. package/dist/configs/{formatters.js → formatters.mjs} +6 -3
  28. package/dist/configs/ignores.d.mts +8 -0
  29. package/dist/configs/{ignores.js → ignores.mjs} +6 -3
  30. package/dist/configs/{imports.d.ts → imports.d.mts} +3 -1
  31. package/dist/configs/{imports.js → imports.mjs} +5 -2
  32. package/dist/configs/index.d.mts +29 -0
  33. package/dist/configs/index.mjs +30 -0
  34. package/dist/configs/{javascript.d.ts → javascript.d.mts} +3 -1
  35. package/dist/configs/{javascript.js → javascript.mjs} +5 -7
  36. package/dist/configs/{jsdoc.d.ts → jsdoc.d.mts} +3 -1
  37. package/dist/configs/{jsdoc.js → jsdoc.mjs} +7 -4
  38. package/dist/configs/{jsonc.d.ts → jsonc.d.mts} +3 -1
  39. package/dist/configs/{jsonc.js → jsonc.mjs} +7 -4
  40. package/dist/configs/{markdown.d.ts → markdown.d.mts} +3 -1
  41. package/dist/configs/{markdown.js → markdown.mjs} +5 -2
  42. package/dist/configs/node.d.mts +8 -0
  43. package/dist/configs/{node.js → node.mjs} +5 -2
  44. package/dist/configs/{nuxt.d.ts → nuxt.d.mts} +3 -1
  45. package/dist/configs/{nuxt.js → nuxt.mjs} +18 -15
  46. package/dist/configs/{perfectionist.d.ts → perfectionist.d.mts} +3 -1
  47. package/dist/configs/{perfectionist.js → perfectionist.mjs} +4 -1
  48. package/dist/configs/pnpm.d.mts +8 -0
  49. package/dist/configs/{pnpm.js → pnpm.mjs} +6 -6
  50. package/dist/configs/{regexp.d.ts → regexp.d.mts} +3 -1
  51. package/dist/configs/{regexp.js → regexp.mjs} +3 -0
  52. package/dist/configs/{sort.d.ts → sort.d.mts} +3 -1
  53. package/dist/configs/{sort.js → sort.mjs} +3 -0
  54. package/dist/configs/{stylistic.d.ts → stylistic.d.mts} +3 -1
  55. package/dist/configs/{stylistic.js → stylistic.mjs} +5 -2
  56. package/dist/configs/{test.d.ts → test.d.mts} +3 -1
  57. package/dist/configs/{test.js → test.mjs} +5 -2
  58. package/dist/configs/{toml.d.ts → toml.d.mts} +3 -1
  59. package/dist/configs/{toml.js → toml.mjs} +7 -4
  60. package/dist/configs/{typescript.d.ts → typescript.d.mts} +3 -1
  61. package/dist/configs/{typescript.js → typescript.mjs} +17 -14
  62. package/dist/configs/unicorn.d.mts +8 -0
  63. package/dist/configs/unicorn.mjs +66 -0
  64. package/dist/configs/{vue.d.ts → vue.d.mts} +3 -1
  65. package/dist/configs/{vue.js → vue.mjs} +22 -11
  66. package/dist/configs/{yaml.d.ts → yaml.d.mts} +3 -1
  67. package/dist/configs/{yaml.js → yaml.mjs} +7 -4
  68. package/dist/{factory.d.ts → factory.d.mts} +4 -2
  69. package/dist/{factory.js → factory.mjs} +36 -33
  70. package/dist/{globs.d.ts → globs.d.mts} +2 -0
  71. package/dist/{globs.js → globs.mjs} +3 -0
  72. package/dist/{index.d.ts → index.d.mts} +9 -7
  73. package/dist/{index.js → index.mjs} +7 -4
  74. package/dist/node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/{index.js → index.mjs} +3 -0
  75. package/dist/package.mjs +7 -0
  76. package/dist/{plugins.js → plugins.mjs} +3 -0
  77. package/dist/{typegen.d.ts → typegen.d.mts} +1248 -218
  78. package/dist/{types.d.ts → types.d.mts} +14 -4
  79. package/dist/{utils.d.ts → utils.d.mts} +3 -1
  80. package/dist/{utils.js → utils.mjs} +4 -1
  81. package/dist/vendored/{prettier_types.d.ts → prettier_types.d.mts} +3 -1
  82. package/package.json +80 -49
  83. package/bin/index.js +0 -3
  84. package/dist/cli/index.d.ts +0 -1
  85. package/dist/config_presets.d.ts +0 -7
  86. package/dist/configs/adonisjs.d.ts +0 -6
  87. package/dist/configs/command.d.ts +0 -6
  88. package/dist/configs/comments.d.ts +0 -6
  89. package/dist/configs/disables.d.ts +0 -6
  90. package/dist/configs/e18e.d.ts +0 -6
  91. package/dist/configs/ignores.d.ts +0 -6
  92. package/dist/configs/index.d.ts +0 -27
  93. package/dist/configs/index.js +0 -27
  94. package/dist/configs/node.d.ts +0 -6
  95. package/dist/configs/pnpm.d.ts +0 -6
  96. package/dist/configs/unicorn.d.ts +0 -6
  97. package/dist/configs/unicorn.js +0 -40
  98. package/dist/package.js +0 -4
@@ -1,33 +1,36 @@
1
- import { findUpSync } from "./node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js";
2
- import { GLOB_MARKDOWN } from "./globs.js";
3
- import { interopDefault, isInEditorEnv } from "./utils.js";
4
- import { adonisjs } from "./configs/adonisjs.js";
5
- import { astro } from "./configs/astro.js";
6
- import { command } from "./configs/command.js";
7
- import { comments } from "./configs/comments.js";
8
- import { disables } from "./configs/disables.js";
9
- import { e18e } from "./configs/e18e.js";
10
- import { stylistic } from "./configs/stylistic.js";
11
- import { formatters } from "./configs/formatters.js";
12
- import { ignores } from "./configs/ignores.js";
13
- import { imports } from "./configs/imports.js";
14
- import { javascript } from "./configs/javascript.js";
15
- import { jsdoc } from "./configs/jsdoc.js";
16
- import { jsonc } from "./configs/jsonc.js";
17
- import { markdown } from "./configs/markdown.js";
18
- import { node } from "./configs/node.js";
19
- import { nuxt } from "./configs/nuxt.js";
20
- import { perfectionist } from "./configs/perfectionist.js";
21
- import { pnpm } from "./configs/pnpm.js";
22
- import { regexp } from "./configs/regexp.js";
23
- import { sortPackageJson, sortTsconfig } from "./configs/sort.js";
24
- import { test } from "./configs/test.js";
25
- import { toml } from "./configs/toml.js";
26
- import { typescript } from "./configs/typescript.js";
27
- import { unicorn } from "./configs/unicorn.js";
28
- import { vue } from "./configs/vue.js";
29
- import { yaml } from "./configs/yaml.js";
30
- import "./configs/index.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { findUpSync } from "./node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.mjs";
5
+ import { GLOB_MARKDOWN } from "./globs.mjs";
6
+ import { interopDefault, isInEditorEnv } from "./utils.mjs";
7
+ import { adonisjs } from "./configs/adonisjs.mjs";
8
+ import { astro } from "./configs/astro.mjs";
9
+ import { command } from "./configs/command.mjs";
10
+ import { comments } from "./configs/comments.mjs";
11
+ import { disables } from "./configs/disables.mjs";
12
+ import { e18e } from "./configs/e18e.mjs";
13
+ import { stylistic } from "./configs/stylistic.mjs";
14
+ import { formatters } from "./configs/formatters.mjs";
15
+ import { ignores } from "./configs/ignores.mjs";
16
+ import { imports } from "./configs/imports.mjs";
17
+ import { javascript } from "./configs/javascript.mjs";
18
+ import { jsdoc } from "./configs/jsdoc.mjs";
19
+ import { jsonc } from "./configs/jsonc.mjs";
20
+ import { markdown } from "./configs/markdown.mjs";
21
+ import { node } from "./configs/node.mjs";
22
+ import { nuxt } from "./configs/nuxt.mjs";
23
+ import { perfectionist } from "./configs/perfectionist.mjs";
24
+ import { pnpm } from "./configs/pnpm.mjs";
25
+ import { regexp } from "./configs/regexp.mjs";
26
+ import { sortPackageJson, sortTsconfig } from "./configs/sort.mjs";
27
+ import { test } from "./configs/test.mjs";
28
+ import { toml } from "./configs/toml.mjs";
29
+ import { typescript } from "./configs/typescript.mjs";
30
+ import { unicorn } from "./configs/unicorn.mjs";
31
+ import { vue } from "./configs/vue.mjs";
32
+ import { yaml } from "./configs/yaml.mjs";
33
+ import "./configs/index.mjs";
31
34
  import { FlatConfigComposer } from "eslint-flat-config-utils";
32
35
  import { isPackageExists } from "local-pkg";
33
36
  //#region src/factory.ts
@@ -80,7 +83,7 @@ function eienjs(options = {}) {
80
83
  stylistic: stylisticOptions,
81
84
  ...resolveSubOptions(options, "imports")
82
85
  }));
83
- if (enableE18e) configs.push(e18e({ ...enableE18e === true ? {} : enableE18e }));
86
+ if (enableE18e) configs.push(e18e({ ...enableE18e !== true && enableE18e }));
84
87
  if (enableUnicorn) configs.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
85
88
  if (enableVue) componentExts.push("vue");
86
89
  if (enableTypeScript) configs.push(typescript({
@@ -149,7 +152,7 @@ function eienjs(options = {}) {
149
152
  "Place it in the second or later config instead."
150
153
  ].join(""));
151
154
  const fusedConfig = flatConfigProps.reduce((acc, key) => {
152
- if (key in options) acc[key] = options[key];
155
+ if (Object.hasOwn(options, key)) acc[key] = options[key];
153
156
  return acc;
154
157
  }, {});
155
158
  if (Object.keys(fusedConfig).length > 0) configs.push([fusedConfig]);
@@ -169,7 +172,7 @@ function resolveSubOptions(options, key) {
169
172
  }
170
173
  function getOverrides(options, key) {
171
174
  const sub = resolveSubOptions(options, key);
172
- return { ..."overrides" in sub ? sub.overrides : {} };
175
+ return { ..."overrides" in sub && sub.overrides };
173
176
  }
174
177
  //#endregion
175
178
  export { defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions };
@@ -1,3 +1,5 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
1
3
  //#region src/globs.d.ts
2
4
  declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
3
5
  declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
@@ -1,3 +1,6 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
1
4
  //#region src/globs.ts
2
5
  const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
3
6
  const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
@@ -1,7 +1,9 @@
1
- import { ConfigNames, RuleOptions } from "./typegen.js";
2
- import { Awaitable, OptionsAdonisJS, OptionsComponentExts, OptionsConfig, OptionsE18e, OptionsErasableSyntaxOnly, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsMarkdown, OptionsNuxt, OptionsOverrides, OptionsPnpm, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsTypescriptWithErasableSyntaxOnly, OptionsVue, Rules, StylisticConfig, TypedFlatConfigItem } from "./types.js";
3
- import { ResolvedOptions, defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions } from "./factory.js";
4
- import { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON } from "./config_presets.js";
5
- import { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_EXTS, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML } from "./globs.js";
6
- import { combine, ensurePackages, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, toArray } from "./utils.js";
7
- export { type Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_EXTS, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, type OptionsAdonisJS, type OptionsComponentExts, type OptionsConfig, type OptionsE18e, type OptionsErasableSyntaxOnly, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsMarkdown, type OptionsNuxt, type OptionsOverrides, type OptionsPnpm, type OptionsRegExp, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsTypescriptWithErasableSyntaxOnly, type OptionsVue, ResolvedOptions, type RuleOptions, type Rules, type StylisticConfig, type TypedFlatConfigItem, combine, eienjs as default, defaultPluginRenaming, eienjs, ensurePackages, getOverrides, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, resolveSubOptions, toArray };
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ConfigNames, RuleOptions } from "./typegen.mjs";
4
+ import { Awaitable, OptionsAdonisJS, OptionsComponentExts, OptionsConfig, OptionsE18e, OptionsErasableSyntaxOnly, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsMarkdown, OptionsNuxt, OptionsOverrides, OptionsPnpm, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsTypescriptWithErasableSyntaxOnly, OptionsUnicorn, OptionsVue, Rules, StylisticConfig, TypedFlatConfigItem } from "./types.mjs";
5
+ import { ResolvedOptions, defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions } from "./factory.mjs";
6
+ import { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON } from "./config_presets.mjs";
7
+ import { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_EXTS, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML } from "./globs.mjs";
8
+ import { combine, ensurePackages, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, toArray } from "./utils.mjs";
9
+ export { type Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_EXTS, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, type OptionsAdonisJS, type OptionsComponentExts, type OptionsConfig, type OptionsE18e, type OptionsErasableSyntaxOnly, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsMarkdown, type OptionsNuxt, type OptionsOverrides, type OptionsPnpm, type OptionsRegExp, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsTypescriptWithErasableSyntaxOnly, type OptionsUnicorn, type OptionsVue, ResolvedOptions, type RuleOptions, type Rules, type StylisticConfig, type TypedFlatConfigItem, combine, eienjs as default, defaultPluginRenaming, eienjs, ensurePackages, getOverrides, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, resolveSubOptions, toArray };
@@ -1,7 +1,10 @@
1
- import { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_EXTS, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML } from "./globs.js";
2
- import { combine, ensurePackages, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, toArray } from "./utils.js";
3
- import { defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions } from "./factory.js";
4
- import { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON } from "./config_presets.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_EXTS, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML } from "./globs.mjs";
5
+ import { combine, ensurePackages, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, toArray } from "./utils.mjs";
6
+ import { defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions } from "./factory.mjs";
7
+ import { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON } from "./config_presets.mjs";
5
8
  //#region src/index.ts
6
9
  var src_default = eienjs;
7
10
  //#endregion
@@ -1,3 +1,6 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
1
4
  import process from "node:process";
2
5
  import fsPromises from "node:fs/promises";
3
6
  import { fileURLToPath } from "node:url";
@@ -0,0 +1,7 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ //#region package.json
5
+ var version = "2.1.0";
6
+ //#endregion
7
+ export { version };
@@ -1,3 +1,6 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
1
4
  import pluginE18e from "@e18e/eslint-plugin";
2
5
  import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
3
6
  import pluginAntfu from "eslint-plugin-antfu";