@eienjs/eslint-config 2.0.1 → 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 (97) hide show
  1. package/bin/index.mjs +3 -0
  2. package/dist/cli/{constants.js → constants.mjs} +3 -0
  3. package/dist/cli/{constants_generated.js → constants_generated.mjs} +6 -3
  4. package/dist/cli/index.d.mts +2 -0
  5. package/dist/cli/{index.js → index.mjs} +5 -2
  6. package/dist/cli/{run.js → run.mjs} +12 -9
  7. package/dist/cli/stages/{update_eslint_files.js → update_eslint_files.mjs} +4 -1
  8. package/dist/cli/stages/{update_package_json.js → update_package_json.mjs} +15 -13
  9. package/dist/cli/stages/{update_vscode_settings.js → update_vscode_settings.mjs} +5 -2
  10. package/dist/cli/{utils.js → utils.mjs} +3 -0
  11. package/dist/config_presets.d.mts +9 -0
  12. package/dist/{config_presets.js → config_presets.mjs} +3 -0
  13. package/dist/configs/adonisjs.d.mts +8 -0
  14. package/dist/configs/{adonisjs.js → adonisjs.mjs} +27 -24
  15. package/dist/configs/{astro.d.ts → astro.d.mts} +3 -1
  16. package/dist/configs/{astro.js → astro.mjs} +6 -3
  17. package/dist/configs/command.d.mts +8 -0
  18. package/dist/configs/{command.js → command.mjs} +3 -0
  19. package/dist/configs/comments.d.mts +8 -0
  20. package/dist/configs/{comments.js → comments.mjs} +4 -1
  21. package/dist/configs/disables.d.mts +8 -0
  22. package/dist/configs/{disables.js → disables.mjs} +4 -1
  23. package/dist/configs/e18e.d.mts +8 -0
  24. package/dist/configs/{e18e.js → e18e.mjs} +7 -4
  25. package/dist/configs/{formatters.d.ts → formatters.d.mts} +3 -1
  26. package/dist/configs/{formatters.js → formatters.mjs} +6 -3
  27. package/dist/configs/ignores.d.mts +8 -0
  28. package/dist/configs/{ignores.js → ignores.mjs} +6 -3
  29. package/dist/configs/{imports.d.ts → imports.d.mts} +3 -1
  30. package/dist/configs/{imports.js → imports.mjs} +5 -2
  31. package/dist/configs/index.d.mts +29 -0
  32. package/dist/configs/index.mjs +30 -0
  33. package/dist/configs/{javascript.d.ts → javascript.d.mts} +3 -1
  34. package/dist/configs/{javascript.js → javascript.mjs} +4 -1
  35. package/dist/configs/{jsdoc.d.ts → jsdoc.d.mts} +3 -1
  36. package/dist/configs/{jsdoc.js → jsdoc.mjs} +7 -4
  37. package/dist/configs/{jsonc.d.ts → jsonc.d.mts} +3 -1
  38. package/dist/configs/{jsonc.js → jsonc.mjs} +7 -4
  39. package/dist/configs/{markdown.d.ts → markdown.d.mts} +3 -1
  40. package/dist/configs/{markdown.js → markdown.mjs} +5 -2
  41. package/dist/configs/node.d.mts +8 -0
  42. package/dist/configs/{node.js → node.mjs} +5 -2
  43. package/dist/configs/{nuxt.d.ts → nuxt.d.mts} +3 -1
  44. package/dist/configs/{nuxt.js → nuxt.mjs} +18 -15
  45. package/dist/configs/{perfectionist.d.ts → perfectionist.d.mts} +3 -1
  46. package/dist/configs/{perfectionist.js → perfectionist.mjs} +4 -1
  47. package/dist/configs/pnpm.d.mts +8 -0
  48. package/dist/configs/{pnpm.js → pnpm.mjs} +6 -3
  49. package/dist/configs/{regexp.d.ts → regexp.d.mts} +3 -1
  50. package/dist/configs/{regexp.js → regexp.mjs} +3 -0
  51. package/dist/configs/{sort.d.ts → sort.d.mts} +3 -1
  52. package/dist/configs/{sort.js → sort.mjs} +3 -0
  53. package/dist/configs/{stylistic.d.ts → stylistic.d.mts} +3 -1
  54. package/dist/configs/{stylistic.js → stylistic.mjs} +5 -2
  55. package/dist/configs/{test.d.ts → test.d.mts} +3 -1
  56. package/dist/configs/{test.js → test.mjs} +5 -2
  57. package/dist/configs/{toml.d.ts → toml.d.mts} +3 -1
  58. package/dist/configs/{toml.js → toml.mjs} +7 -4
  59. package/dist/configs/{typescript.d.ts → typescript.d.mts} +3 -1
  60. package/dist/configs/{typescript.js → typescript.mjs} +17 -14
  61. package/dist/configs/unicorn.d.mts +8 -0
  62. package/dist/configs/unicorn.mjs +66 -0
  63. package/dist/configs/{vue.d.ts → vue.d.mts} +3 -1
  64. package/dist/configs/{vue.js → vue.mjs} +7 -4
  65. package/dist/configs/{yaml.d.ts → yaml.d.mts} +3 -1
  66. package/dist/configs/{yaml.js → yaml.mjs} +7 -4
  67. package/dist/{factory.d.ts → factory.d.mts} +4 -2
  68. package/dist/{factory.js → factory.mjs} +36 -33
  69. package/dist/{globs.d.ts → globs.d.mts} +2 -0
  70. package/dist/{globs.js → globs.mjs} +3 -0
  71. package/dist/{index.d.ts → index.d.mts} +9 -7
  72. package/dist/{index.js → index.mjs} +7 -4
  73. package/dist/node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/{index.js → index.mjs} +3 -0
  74. package/dist/package.mjs +7 -0
  75. package/dist/{plugins.js → plugins.mjs} +3 -0
  76. package/dist/{typegen.d.ts → typegen.d.mts} +1043 -232
  77. package/dist/{types.d.ts → types.d.mts} +14 -4
  78. package/dist/{utils.d.ts → utils.d.mts} +3 -1
  79. package/dist/{utils.js → utils.mjs} +4 -1
  80. package/dist/vendored/{prettier_types.d.ts → prettier_types.d.mts} +3 -1
  81. package/package.json +34 -31
  82. package/bin/index.js +0 -3
  83. package/dist/cli/index.d.ts +0 -1
  84. package/dist/config_presets.d.ts +0 -7
  85. package/dist/configs/adonisjs.d.ts +0 -6
  86. package/dist/configs/command.d.ts +0 -6
  87. package/dist/configs/comments.d.ts +0 -6
  88. package/dist/configs/disables.d.ts +0 -6
  89. package/dist/configs/e18e.d.ts +0 -6
  90. package/dist/configs/ignores.d.ts +0 -6
  91. package/dist/configs/index.d.ts +0 -27
  92. package/dist/configs/index.js +0 -27
  93. package/dist/configs/node.d.ts +0 -6
  94. package/dist/configs/pnpm.d.ts +0 -6
  95. package/dist/configs/unicorn.d.ts +0 -6
  96. package/dist/configs/unicorn.js +0 -40
  97. package/dist/package.js +0 -4
package/bin/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ import '../dist/cli/index.mjs';
@@ -1,3 +1,6 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
1
4
  import c from "ansis";
2
5
  //#region src/cli/constants.ts
3
6
  const vscodeSettingsString = `
@@ -1,10 +1,13 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
1
4
  //#region src/cli/constants_generated.ts
2
5
  const versionsMap = {
3
6
  "@adonisjs/eslint-plugin": "^2.2.2",
4
7
  "@nuxt/eslint-plugin": "^1.16.0",
5
- "astro-eslint-parser": "^1.4.0",
6
- "eslint": "^10.4.1",
7
- "eslint-plugin-astro": "^1.7.0",
8
+ "astro-eslint-parser": "^2.0.0",
9
+ "eslint": "^10.5.0",
10
+ "eslint-plugin-astro": "^2.0.0",
8
11
  "eslint-plugin-format": "^2.0.1",
9
12
  "prettier-plugin-astro": "^0.14.1"
10
13
  };
@@ -0,0 +1,2 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
@@ -1,5 +1,8 @@
1
- import { version } from "../package.js";
2
- import { run } from "./run.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { version } from "../package.mjs";
5
+ import { run } from "./run.mjs";
3
6
  import process from "node:process";
4
7
  import * as p from "@clack/prompts";
5
8
  import c from "ansis";
@@ -1,8 +1,11 @@
1
- import { extra, extraOptions, frameworkOptions, frameworks } from "./constants.js";
2
- import { isGitClean } from "./utils.js";
3
- import { updateEslintFiles } from "./stages/update_eslint_files.js";
4
- import { updatePackageJson } from "./stages/update_package_json.js";
5
- import { updateVscodeSettings } from "./stages/update_vscode_settings.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { extra, extraOptions, frameworkOptions, frameworks } from "./constants.mjs";
5
+ import { isGitClean } from "./utils.mjs";
6
+ import { updateEslintFiles } from "./stages/update_eslint_files.mjs";
7
+ import { updatePackageJson } from "./stages/update_package_json.mjs";
8
+ import { updateVscodeSettings } from "./stages/update_vscode_settings.mjs";
6
9
  import process from "node:process";
7
10
  import fs from "node:fs";
8
11
  import path from "node:path";
@@ -10,13 +13,13 @@ import * as p from "@clack/prompts";
10
13
  import c from "ansis";
11
14
  //#region src/cli/run.ts
12
15
  async function run(options = {}) {
13
- const argSkipPrompt = Boolean(process.env.SKIP_PROMPT) || options.yes;
14
- const argTemplate = options.frameworks?.map((m) => m.trim()).filter(Boolean);
15
- const argExtra = options.extra?.map((m) => m.trim()).filter(Boolean);
16
16
  if (fs.existsSync(path.join(process.cwd(), "eslint.config.js"))) {
17
17
  p.log.warn(c.yellow`eslint.config.js already exists, migration wizard exited.`);
18
18
  return process.exit(1);
19
19
  }
20
+ const argSkipPrompt = Boolean(process.env.SKIP_PROMPT) || options.yes;
21
+ const argTemplate = options.frameworks?.map((m) => m.trim()).filter(Boolean);
22
+ const argExtra = options.extra?.map((m) => m.trim()).filter(Boolean);
20
23
  let result = {
21
24
  extra: argExtra ?? [],
22
25
  frameworks: argTemplate ?? [],
@@ -43,7 +46,7 @@ async function run(options = {}) {
43
46
  });
44
47
  },
45
48
  extra: async ({ results }) => {
46
- const isArgExtraValid = argExtra?.length && !argExtra.some((element) => !extra.includes(element));
49
+ const isArgExtraValid = argExtra?.length && argExtra.every((element) => extra.includes(element));
47
50
  if (!results.uncommittedConfirmed || isArgExtraValid) return;
48
51
  const message = argExtra ? `"${argExtra.toString()}" isn't a valid extra util. Please choose from below: ` : "Select a extra utils:";
49
52
  return p.multiselect({
@@ -1,4 +1,7 @@
1
- import { getEslintConfigContent } from "../utils.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { getEslintConfigContent } from "../utils.mjs";
2
5
  import process from "node:process";
3
6
  import fsPromises from "node:fs/promises";
4
7
  import fs from "node:fs";
@@ -1,6 +1,9 @@
1
- import { version } from "../../package.js";
2
- import { dependenciesMap } from "../constants.js";
3
- import { versionsMap } from "../constants_generated.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { version } from "../../package.mjs";
5
+ import { dependenciesMap } from "../constants.mjs";
6
+ import { versionsMap } from "../constants_generated.mjs";
4
7
  import process from "node:process";
5
8
  import fsPromises from "node:fs/promises";
6
9
  import path from "node:path";
@@ -13,20 +16,19 @@ async function updatePackageJson(result) {
13
16
  p.log.step(c.cyan`Bumping @eienjs/eslint-config to v${version}`);
14
17
  const pkgContent = await fsPromises.readFile(pathPackageJSON, "utf8");
15
18
  const pkg = JSON.parse(pkgContent);
16
- pkg.devDependencies = pkg.devDependencies ?? {};
19
+ pkg.devDependencies ??= {};
17
20
  pkg.devDependencies["@eienjs/eslint-config"] = `^${version}`;
18
- pkg.devDependencies.eslint = pkg.devDependencies.eslint ?? versionsMap.eslint;
21
+ pkg.devDependencies.eslint ??= versionsMap.eslint;
19
22
  const addedPackages = [];
20
23
  if (result.extra.length > 0) {
21
24
  const extraPackages = result.extra;
22
- for (const item of extraPackages) switch (item) {
23
- case "formatter":
24
- for (const f of [...dependenciesMap.formatter, ...result.frameworks.includes("astro") ? dependenciesMap.formatterAstro : []]) {
25
- if (!f) continue;
26
- pkg.devDependencies[f] = versionsMap[f];
27
- addedPackages.push(f);
28
- }
29
- break;
25
+ for (const item of extraPackages) {
26
+ if (item !== "formatter") continue;
27
+ for (const f of [...dependenciesMap.formatter, ...result.frameworks.includes("astro") ? dependenciesMap.formatterAstro : []]) {
28
+ if (!f) continue;
29
+ pkg.devDependencies[f] = versionsMap[f];
30
+ addedPackages.push(f);
31
+ }
30
32
  }
31
33
  }
32
34
  for (const framework of result.frameworks) {
@@ -1,4 +1,7 @@
1
- import { vscodeSettingsString } from "../constants.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { vscodeSettingsString } from "../constants.mjs";
2
5
  import process from "node:process";
3
6
  import fsPromises from "node:fs/promises";
4
7
  import fs from "node:fs";
@@ -8,8 +11,8 @@ import { green } from "ansis";
8
11
  //#region src/cli/stages/update_vscode_settings.ts
9
12
  const LAST_LINE_PATTERN = /\s*\}$/;
10
13
  async function updateVscodeSettings(result) {
11
- const cwd = process.cwd();
12
14
  if (!result.updateVscodeSettings) return;
15
+ const cwd = process.cwd();
13
16
  const dotVscodePath = path.join(cwd, ".vscode");
14
17
  const settingsPath = path.join(dotVscodePath, "settings.json");
15
18
  if (!fs.existsSync(dotVscodePath)) await fsPromises.mkdir(dotVscodePath, { recursive: true });
@@ -1,3 +1,6 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
1
4
  import { execSync } from "node:child_process";
2
5
  //#region src/cli/utils.ts
3
6
  function isGitClean() {
@@ -0,0 +1,9 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { OptionsConfig } from "./types.mjs";
4
+
5
+ //#region src/config_presets.d.ts
6
+ declare const CONFIG_PRESET_FULL_ON: OptionsConfig;
7
+ declare const CONFIG_PRESET_FULL_OFF: OptionsConfig;
8
+ //#endregion
9
+ export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON };
@@ -1,3 +1,6 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
1
4
  //#region src/config_presets.ts
2
5
  const CONFIG_PRESET_FULL_ON = {
3
6
  adonisjs: true,
@@ -0,0 +1,8 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { OptionsAdonisJS, TypedFlatConfigItem } from "../types.mjs";
4
+
5
+ //#region src/configs/adonisjs.d.ts
6
+ declare function adonisjs(options?: OptionsAdonisJS): Promise<TypedFlatConfigItem[]>;
7
+ //#endregion
8
+ export { adonisjs };
@@ -1,34 +1,37 @@
1
- import { GLOB_SRC_EXT } from "../globs.js";
2
- import { ensurePackages, interopDefault } from "../utils.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { GLOB_SRC_EXT } from "../globs.mjs";
5
+ import { ensurePackages, interopDefault } from "../utils.mjs";
3
6
  import { join } from "pathe";
4
7
  //#region src/configs/adonisjs.ts
5
8
  async function adonisjs(options = {}) {
6
9
  const { dirs = {}, overrides = {} } = options;
7
10
  await ensurePackages(["@adonisjs/eslint-plugin"]);
8
11
  const pluginAdonisJS = await interopDefault(import("@adonisjs/eslint-plugin"));
9
- dirs.root = dirs.root || ".";
12
+ dirs.root ||= ".";
10
13
  const appPath = `${dirs.root}/app`;
11
- dirs.controllers = dirs.controllers || `${appPath}/controllers`;
12
- dirs.exceptions = dirs.exceptions || `${appPath}/exceptions`;
13
- dirs.models = dirs.models || `${appPath}/models`;
14
- dirs.mails = dirs.mails || `${appPath}/mails`;
15
- dirs.services = dirs.services || `${appPath}/services`;
16
- dirs.listeners = dirs.listeners || `${appPath}/listeners`;
17
- dirs.events = dirs.events || `${appPath}/events`;
18
- dirs.middleware = dirs.middleware || `${appPath}/middleware`;
19
- dirs.transformers = dirs.transformers || `${appPath}/transformers`;
20
- dirs.validators = dirs.validators || `${appPath}/validators`;
21
- dirs.providers = dirs.providers || `${dirs.root}/providers`;
22
- dirs.policies = dirs.policies || `${appPath}/policies`;
23
- dirs.abilities = dirs.abilities || `${appPath}/abilities`;
24
- dirs.database = dirs.database || `${dirs.root}/database`;
25
- dirs.bin = dirs.bin || `${dirs.root}/bin`;
26
- dirs.start = dirs.start || `${dirs.root}/start`;
27
- dirs.tests = dirs.tests || `${dirs.root}/tests`;
28
- dirs.config = dirs.config || `${dirs.root}/config`;
29
- dirs.commands = dirs.commands || `${dirs.root}/commands`;
30
- dirs.inertia = dirs.inertia || `${dirs.root}/inertia`;
31
- dirs.types = dirs.types || `${appPath}/types`;
14
+ dirs.controllers ||= `${appPath}/controllers`;
15
+ dirs.exceptions ||= `${appPath}/exceptions`;
16
+ dirs.models ||= `${appPath}/models`;
17
+ dirs.mails ||= `${appPath}/mails`;
18
+ dirs.services ||= `${appPath}/services`;
19
+ dirs.listeners ||= `${appPath}/listeners`;
20
+ dirs.events ||= `${appPath}/events`;
21
+ dirs.middleware ||= `${appPath}/middleware`;
22
+ dirs.transformers ||= `${appPath}/transformers`;
23
+ dirs.validators ||= `${appPath}/validators`;
24
+ dirs.providers ||= `${dirs.root}/providers`;
25
+ dirs.policies ||= `${appPath}/policies`;
26
+ dirs.abilities ||= `${appPath}/abilities`;
27
+ dirs.database ||= `${dirs.root}/database`;
28
+ dirs.bin ||= `${dirs.root}/bin`;
29
+ dirs.start ||= `${dirs.root}/start`;
30
+ dirs.tests ||= `${dirs.root}/tests`;
31
+ dirs.config ||= `${dirs.root}/config`;
32
+ dirs.commands ||= `${dirs.root}/commands`;
33
+ dirs.inertia ||= `${dirs.root}/inertia`;
34
+ dirs.types ||= `${appPath}/types`;
32
35
  const nestedGlobPattern = `**/*.${GLOB_SRC_EXT}`;
33
36
  const fileRoutes = [...Object.values(dirs).map((dir) => join(dir, nestedGlobPattern)), `${dirs.root}/ace.js`];
34
37
  const commonRulesSet = {
@@ -1,4 +1,6 @@
1
- import { OptionsFiles, OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.js";
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { OptionsFiles, OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.mjs";
2
4
 
3
5
  //#region src/configs/astro.d.ts
4
6
  declare function astro(options?: OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
@@ -1,5 +1,8 @@
1
- import { GLOB_ASTRO } from "../globs.js";
2
- import { interopDefault } from "../utils.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { GLOB_ASTRO } from "../globs.mjs";
5
+ import { interopDefault } from "../utils.mjs";
3
6
  //#region src/configs/astro.ts
4
7
  async function astro(options = {}) {
5
8
  const { files = [GLOB_ASTRO], overrides = {}, stylistic = true } = options;
@@ -36,7 +39,7 @@ async function astro(options = {}) {
36
39
  "astro/no-unused-define-vars-in-style": "error",
37
40
  "astro/semi": "off",
38
41
  "astro/valid-compile": "error",
39
- ...stylistic ? {} : {
42
+ ...!stylistic && {
40
43
  "@stylistic/indent": "off",
41
44
  "@stylistic/jsx-closing-tag-location": "off",
42
45
  "@stylistic/jsx-one-expression-per-line": "off",
@@ -0,0 +1,8 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { TypedFlatConfigItem } from "../types.mjs";
4
+
5
+ //#region src/configs/command.d.ts
6
+ declare function command(): TypedFlatConfigItem[];
7
+ //#endregion
8
+ export { command };
@@ -1,3 +1,6 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
1
4
  import createCommand from "eslint-plugin-command/config";
2
5
  //#region src/configs/command.ts
3
6
  function command() {
@@ -0,0 +1,8 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { TypedFlatConfigItem } from "../types.mjs";
4
+
5
+ //#region src/configs/comments.d.ts
6
+ declare function comments(): TypedFlatConfigItem[];
7
+ //#endregion
8
+ export { comments };
@@ -1,4 +1,7 @@
1
- import { pluginComments } from "../plugins.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { pluginComments } from "../plugins.mjs";
2
5
  //#region src/configs/comments.ts
3
6
  function comments() {
4
7
  return [{
@@ -0,0 +1,8 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { TypedFlatConfigItem } from "../types.mjs";
4
+
5
+ //#region src/configs/disables.d.ts
6
+ declare function disables(): TypedFlatConfigItem[];
7
+ //#endregion
8
+ export { disables };
@@ -1,4 +1,7 @@
1
- import { GLOB_ASTRO, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_SRC, GLOB_SRC_EXT, GLOB_TOML, GLOB_YAML } from "../globs.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { GLOB_ASTRO, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_SRC, GLOB_SRC_EXT, GLOB_TOML, GLOB_YAML } from "../globs.mjs";
2
5
  //#region src/configs/disables.ts
3
6
  function disables() {
4
7
  return [
@@ -0,0 +1,8 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { OptionsE18e, TypedFlatConfigItem } from "../types.mjs";
4
+
5
+ //#region src/configs/e18e.d.ts
6
+ declare function e18e(options?: OptionsE18e): TypedFlatConfigItem[];
7
+ //#endregion
8
+ export { e18e };
@@ -1,4 +1,7 @@
1
- import { pluginE18e } from "../plugins.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { pluginE18e } from "../plugins.mjs";
2
5
  //#region src/configs/e18e.ts
3
6
  function e18e(options = {}) {
4
7
  const { modernization = true, moduleReplacements = false, overrides = {}, performanceImprovements = true } = options;
@@ -9,9 +12,9 @@ function e18e(options = {}) {
9
12
  }, {
10
13
  name: "eienjs/e18e/rules",
11
14
  rules: {
12
- ...modernization ? { ...configs.modernization.rules } : {},
13
- ...moduleReplacements ? { ...configs.moduleReplacements.rules } : {},
14
- ...performanceImprovements ? { ...configs.performanceImprovements.rules } : {},
15
+ ...modernization && { ...configs.modernization.rules },
16
+ ...moduleReplacements && { ...configs.moduleReplacements.rules },
17
+ ...performanceImprovements && { ...configs.performanceImprovements.rules },
15
18
  "e18e/prefer-array-at": "off",
16
19
  "e18e/prefer-array-from-map": "off",
17
20
  "e18e/prefer-array-to-reversed": "off",
@@ -1,4 +1,6 @@
1
- import { OptionsFormatters, StylisticConfig, TypedFlatConfigItem } from "../types.js";
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { OptionsFormatters, StylisticConfig, TypedFlatConfigItem } from "../types.mjs";
2
4
 
3
5
  //#region src/configs/formatters.d.ts
4
6
  declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<TypedFlatConfigItem[]>;
@@ -1,6 +1,9 @@
1
- import { GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_HTML, GLOB_LESS, GLOB_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SVG, GLOB_XML } from "../globs.js";
2
- import { ensurePackages, interopDefault, isPackageInScope, parserPlain } from "../utils.js";
3
- import { StylisticConfigDefaults } from "./stylistic.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_HTML, GLOB_LESS, GLOB_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SVG, GLOB_XML } from "../globs.mjs";
5
+ import { ensurePackages, interopDefault, isPackageInScope, parserPlain } from "../utils.mjs";
6
+ import { StylisticConfigDefaults } from "./stylistic.mjs";
4
7
  //#region src/configs/formatters.ts
5
8
  function mergePrettierOptions(options, overrides) {
6
9
  return {
@@ -0,0 +1,8 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { TypedFlatConfigItem } from "../types.mjs";
4
+
5
+ //#region src/configs/ignores.d.ts
6
+ declare function ignores(userIgnores?: string[] | ((originals: string[]) => string[]), shouldIgnoreTypescript?: boolean): TypedFlatConfigItem[];
7
+ //#endregion
8
+ export { ignores };
@@ -1,8 +1,11 @@
1
- import { GLOB_EXCLUDE, GLOB_TS, GLOB_TSX } from "../globs.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { GLOB_EXCLUDE, GLOB_TS, GLOB_TSX } from "../globs.mjs";
2
5
  //#region src/configs/ignores.ts
3
- function ignores(userIgnores = [], ignoreTypescript = false) {
6
+ function ignores(userIgnores = [], shouldIgnoreTypescript = false) {
4
7
  let ignores = [...GLOB_EXCLUDE];
5
- if (ignoreTypescript) ignores.push(GLOB_TS, GLOB_TSX);
8
+ if (shouldIgnoreTypescript) ignores.push(GLOB_TS, GLOB_TSX);
6
9
  ignores = typeof userIgnores === "function" ? userIgnores(ignores) : [...ignores, ...userIgnores];
7
10
  return [{
8
11
  ignores,
@@ -1,4 +1,6 @@
1
- import { OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.js";
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.mjs";
2
4
 
3
5
  //#region src/configs/imports.d.ts
4
6
  declare function imports(options?: OptionsOverrides & OptionsStylistic): TypedFlatConfigItem[];
@@ -1,4 +1,7 @@
1
- import { pluginAntfu, pluginImportLite } from "../plugins.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { pluginAntfu, pluginImportLite } from "../plugins.mjs";
2
5
  //#region src/configs/imports.ts
3
6
  function imports(options = {}) {
4
7
  const { overrides = {}, stylistic = true } = options;
@@ -17,7 +20,7 @@ function imports(options = {}) {
17
20
  "import/no-duplicates": "error",
18
21
  "import/no-mutable-exports": "error",
19
22
  "import/no-named-default": "error",
20
- ...stylistic ? { "import/newline-after-import": ["error", { count: 1 }] } : {},
23
+ ...stylistic && { "import/newline-after-import": ["error", { count: 1 }] },
21
24
  ...overrides
22
25
  }
23
26
  }];
@@ -0,0 +1,29 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { adonisjs } from "./adonisjs.mjs";
4
+ import { astro } from "./astro.mjs";
5
+ import { command } from "./command.mjs";
6
+ import { comments } from "./comments.mjs";
7
+ import { disables } from "./disables.mjs";
8
+ import { e18e } from "./e18e.mjs";
9
+ import { formatters } from "./formatters.mjs";
10
+ import { ignores } from "./ignores.mjs";
11
+ import { imports } from "./imports.mjs";
12
+ import { javascript } from "./javascript.mjs";
13
+ import { jsdoc } from "./jsdoc.mjs";
14
+ import { jsonc } from "./jsonc.mjs";
15
+ import { markdown } from "./markdown.mjs";
16
+ import { node } from "./node.mjs";
17
+ import { nuxt } from "./nuxt.mjs";
18
+ import { perfectionist } from "./perfectionist.mjs";
19
+ import { pnpm } from "./pnpm.mjs";
20
+ import { regexp } from "./regexp.mjs";
21
+ import { sortPackageJson, sortTsconfig } from "./sort.mjs";
22
+ import { StylisticConfigDefaults, StylisticOptions, stylistic } from "./stylistic.mjs";
23
+ import { test } from "./test.mjs";
24
+ import { toml } from "./toml.mjs";
25
+ import { typescript } from "./typescript.mjs";
26
+ import { unicorn } from "./unicorn.mjs";
27
+ import { vue } from "./vue.mjs";
28
+ import { yaml } from "./yaml.mjs";
29
+ export { StylisticConfigDefaults, StylisticOptions, adonisjs, astro, command, comments, disables, e18e, formatters, ignores, imports, javascript, jsdoc, jsonc, markdown, node, nuxt, perfectionist, pnpm, regexp, sortPackageJson, sortTsconfig, stylistic, test, toml, typescript, unicorn, vue, yaml };
@@ -0,0 +1,30 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { adonisjs } from "./adonisjs.mjs";
5
+ import { astro } from "./astro.mjs";
6
+ import { command } from "./command.mjs";
7
+ import { comments } from "./comments.mjs";
8
+ import { disables } from "./disables.mjs";
9
+ import { e18e } from "./e18e.mjs";
10
+ import { StylisticConfigDefaults, stylistic } from "./stylistic.mjs";
11
+ import { formatters } from "./formatters.mjs";
12
+ import { ignores } from "./ignores.mjs";
13
+ import { imports } from "./imports.mjs";
14
+ import { javascript } from "./javascript.mjs";
15
+ import { jsdoc } from "./jsdoc.mjs";
16
+ import { jsonc } from "./jsonc.mjs";
17
+ import { markdown } from "./markdown.mjs";
18
+ import { node } from "./node.mjs";
19
+ import { nuxt } from "./nuxt.mjs";
20
+ import { perfectionist } from "./perfectionist.mjs";
21
+ import { pnpm } from "./pnpm.mjs";
22
+ import { regexp } from "./regexp.mjs";
23
+ import { sortPackageJson, sortTsconfig } from "./sort.mjs";
24
+ import { test } from "./test.mjs";
25
+ import { toml } from "./toml.mjs";
26
+ import { typescript } from "./typescript.mjs";
27
+ import { unicorn } from "./unicorn.mjs";
28
+ import { vue } from "./vue.mjs";
29
+ import { yaml } from "./yaml.mjs";
30
+ export { StylisticConfigDefaults, adonisjs, astro, command, comments, disables, e18e, formatters, ignores, imports, javascript, jsdoc, jsonc, markdown, node, nuxt, perfectionist, pnpm, regexp, sortPackageJson, sortTsconfig, stylistic, test, toml, typescript, unicorn, vue, yaml };
@@ -1,4 +1,6 @@
1
- import { OptionsIsInEditor, OptionsOverrides, TypedFlatConfigItem } from "../types.js";
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { OptionsIsInEditor, OptionsOverrides, TypedFlatConfigItem } from "../types.mjs";
2
4
 
3
5
  //#region src/configs/javascript.d.ts
4
6
  declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): TypedFlatConfigItem[];
@@ -1,4 +1,7 @@
1
- import { pluginAntfu, pluginUnusedImports } from "../plugins.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { pluginAntfu, pluginUnusedImports } from "../plugins.mjs";
2
5
  import globals from "globals";
3
6
  //#region src/configs/javascript.ts
4
7
  function javascript(options = {}) {
@@ -1,4 +1,6 @@
1
- import { OptionsStylistic, TypedFlatConfigItem } from "../types.js";
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { OptionsStylistic, TypedFlatConfigItem } from "../types.mjs";
2
4
 
3
5
  //#region src/configs/jsdoc.d.ts
4
6
  declare function jsdoc(options?: OptionsStylistic): Promise<TypedFlatConfigItem[]>;
@@ -1,5 +1,8 @@
1
- import { GLOB_SRC } from "../globs.js";
2
- import { interopDefault } from "../utils.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { GLOB_SRC } from "../globs.mjs";
5
+ import { interopDefault } from "../utils.mjs";
3
6
  //#region src/configs/jsdoc.ts
4
7
  async function jsdoc(options = {}) {
5
8
  const { stylistic = true } = options;
@@ -25,10 +28,10 @@ async function jsdoc(options = {}) {
25
28
  "jsdoc/require-returns-check": "warn",
26
29
  "jsdoc/require-returns-description": "warn",
27
30
  "jsdoc/require-yields-check": "warn",
28
- ...stylistic ? {
31
+ ...stylistic && {
29
32
  "jsdoc/check-alignment": "warn",
30
33
  "jsdoc/multiline-blocks": "warn"
31
- } : {}
34
+ }
32
35
  }
33
36
  }];
34
37
  }
@@ -1,4 +1,6 @@
1
- import { OptionsFiles, OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.js";
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { OptionsFiles, OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.mjs";
2
4
 
3
5
  //#region src/configs/jsonc.d.ts
4
6
  declare function jsonc(options?: OptionsFiles & OptionsStylistic & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
@@ -1,5 +1,8 @@
1
- import { GLOB_JSON, GLOB_JSON5, GLOB_JSONC } from "../globs.js";
2
- import { interopDefault } from "../utils.js";
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { GLOB_JSON, GLOB_JSON5, GLOB_JSONC } from "../globs.mjs";
5
+ import { interopDefault } from "../utils.mjs";
3
6
  //#region src/configs/jsonc.ts
4
7
  async function jsonc(options = {}) {
5
8
  const { files = [
@@ -42,7 +45,7 @@ async function jsonc(options = {}) {
42
45
  "jsonc/space-unary-ops": "error",
43
46
  "jsonc/valid-json-number": "error",
44
47
  "jsonc/vue-custom-block/no-parsing-error": "error",
45
- ...stylistic ? {
48
+ ...stylistic && {
46
49
  "jsonc/array-bracket-spacing": ["error", "never"],
47
50
  "jsonc/comma-dangle": ["error", "never"],
48
51
  "jsonc/comma-style": ["error", "last"],
@@ -59,7 +62,7 @@ async function jsonc(options = {}) {
59
62
  "jsonc/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
60
63
  "jsonc/quote-props": "error",
61
64
  "jsonc/quotes": "error"
62
- } : {},
65
+ },
63
66
  ...overrides
64
67
  }
65
68
  }];
@@ -1,4 +1,6 @@
1
- import { OptionsComponentExts, OptionsFiles, OptionsMarkdown, TypedFlatConfigItem } from "../types.js";
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { OptionsComponentExts, OptionsFiles, OptionsMarkdown, TypedFlatConfigItem } from "../types.mjs";
2
4
 
3
5
  //#region src/configs/markdown.d.ts
4
6
  declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsMarkdown): Promise<TypedFlatConfigItem[]>;