@eienjs/eslint-config 1.10.0 → 1.11.1
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.
- package/bin/index.js +3 -0
- package/dist/cli/{constants.mjs → constants.js} +1 -3
- package/dist/cli/{constants_generated.mjs → constants_generated.js} +2 -3
- package/dist/cli/{index.mjs → index.js} +3 -5
- package/dist/cli/{run.mjs → run.js} +6 -8
- package/dist/cli/stages/{update_eslint_files.mjs → update_eslint_files.js} +4 -5
- package/dist/cli/stages/{update_package_json.mjs → update_package_json.js} +4 -6
- package/dist/cli/stages/{update_vscode_settings.mjs → update_vscode_settings.js} +4 -5
- package/dist/cli/{utils.mjs → utils.js} +1 -3
- package/dist/{config_presets.d.mts → config_presets.d.ts} +1 -1
- package/dist/{config_presets.mjs → config_presets.js} +1 -2
- package/dist/configs/{adonisjs.d.mts → adonisjs.d.ts} +1 -1
- package/dist/configs/{adonisjs.mjs → adonisjs.js} +3 -5
- package/dist/configs/{astro.d.mts → astro.d.ts} +1 -1
- package/dist/configs/{astro.mjs → astro.js} +3 -5
- package/dist/configs/{command.d.mts → command.d.ts} +1 -1
- package/dist/configs/{command.mjs → command.js} +1 -3
- package/dist/configs/{comments.d.mts → comments.d.ts} +1 -1
- package/dist/configs/{comments.mjs → comments.js} +2 -4
- package/dist/configs/{disables.d.mts → disables.d.ts} +1 -1
- package/dist/configs/{disables.mjs → disables.js} +2 -4
- package/dist/configs/e18e.d.ts +6 -0
- package/dist/configs/e18e.js +20 -0
- package/dist/configs/{formatters.d.mts → formatters.d.ts} +1 -1
- package/dist/configs/{formatters.mjs → formatters.js} +4 -6
- package/dist/configs/{ignores.d.mts → ignores.d.ts} +1 -1
- package/dist/configs/{ignores.mjs → ignores.js} +2 -4
- package/dist/configs/{imports.d.mts → imports.d.ts} +1 -1
- package/dist/configs/{imports.mjs → imports.js} +2 -4
- package/dist/configs/index.d.ts +27 -0
- package/dist/configs/index.js +27 -0
- package/dist/configs/{javascript.d.mts → javascript.d.ts} +1 -1
- package/dist/configs/{javascript.mjs → javascript.js} +2 -4
- package/dist/configs/{jsdoc.d.mts → jsdoc.d.ts} +1 -1
- package/dist/configs/{jsdoc.mjs → jsdoc.js} +3 -5
- package/dist/configs/{jsonc.d.mts → jsonc.d.ts} +1 -1
- package/dist/configs/{jsonc.mjs → jsonc.js} +3 -5
- package/dist/configs/{markdown.d.mts → markdown.d.ts} +1 -1
- package/dist/configs/{markdown.mjs → markdown.js} +4 -5
- package/dist/configs/{node.d.mts → node.d.ts} +1 -1
- package/dist/configs/{node.mjs → node.js} +3 -5
- package/dist/configs/{nuxt.d.mts → nuxt.d.ts} +1 -1
- package/dist/configs/{nuxt.mjs → nuxt.js} +3 -5
- package/dist/configs/{perfectionist.d.mts → perfectionist.d.ts} +1 -1
- package/dist/configs/{perfectionist.mjs → perfectionist.js} +2 -4
- package/dist/configs/{pnpm.d.mts → pnpm.d.ts} +1 -1
- package/dist/configs/{pnpm.mjs → pnpm.js} +3 -5
- package/dist/configs/{regexp.d.mts → regexp.d.ts} +1 -1
- package/dist/configs/{regexp.mjs → regexp.js} +1 -3
- package/dist/configs/{sort.d.mts → sort.d.ts} +1 -1
- package/dist/configs/{sort.mjs → sort.js} +1 -2
- package/dist/configs/{stylistic.d.mts → stylistic.d.ts} +1 -1
- package/dist/configs/{stylistic.mjs → stylistic.js} +3 -5
- package/dist/configs/{test.d.mts → test.d.ts} +1 -1
- package/dist/configs/{test.mjs → test.js} +3 -5
- package/dist/configs/{toml.d.mts → toml.d.ts} +1 -1
- package/dist/configs/{toml.mjs → toml.js} +3 -5
- package/dist/configs/{typescript.d.mts → typescript.d.ts} +1 -1
- package/dist/configs/{typescript.mjs → typescript.js} +11 -13
- package/dist/configs/{unicorn.d.mts → unicorn.d.ts} +1 -1
- package/dist/configs/{unicorn.mjs → unicorn.js} +3 -5
- package/dist/configs/{vue.d.mts → vue.d.ts} +1 -1
- package/dist/configs/{vue.mjs → vue.js} +3 -5
- package/dist/configs/{yaml.d.mts → yaml.d.ts} +1 -1
- package/dist/configs/{yaml.mjs → yaml.js} +3 -5
- package/dist/{factory.d.mts → factory.d.ts} +2 -2
- package/dist/{factory.mjs → factory.js} +35 -32
- package/dist/{globs.mjs → globs.js} +1 -2
- package/dist/index.d.ts +7 -0
- package/dist/{index.mjs → index.js} +5 -7
- package/dist/node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/{index.mjs → index.js} +1 -3
- package/dist/package.js +4 -0
- package/dist/{plugins.mjs → plugins.js} +2 -2
- package/dist/{typegen.d.mts → typegen.d.ts} +128 -28
- package/dist/{types.d.mts → types.d.ts} +32 -3
- package/dist/{utils.d.mts → utils.d.ts} +1 -1
- package/dist/{utils.mjs → utils.js} +2 -4
- package/package.json +30 -25
- package/bin/index.mjs +0 -3
- package/dist/configs/index.d.mts +0 -26
- package/dist/configs/index.mjs +0 -27
- package/dist/index.d.mts +0 -7
- package/dist/package.mjs +0 -5
- /package/dist/cli/{index.d.mts → index.d.ts} +0 -0
- /package/dist/{globs.d.mts → globs.d.ts} +0 -0
- /package/dist/vendored/{prettier_types.d.mts → prettier_types.d.ts} +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { pluginPerfectionist } from "../plugins.
|
|
2
|
-
|
|
1
|
+
import { pluginPerfectionist } from "../plugins.js";
|
|
3
2
|
//#region src/configs/perfectionist.ts
|
|
4
3
|
/**
|
|
5
4
|
* Perfectionist plugin for props and items sorting.
|
|
@@ -51,6 +50,5 @@ function perfectionist() {
|
|
|
51
50
|
}
|
|
52
51
|
}];
|
|
53
52
|
}
|
|
54
|
-
|
|
55
53
|
//#endregion
|
|
56
|
-
export { perfectionist };
|
|
54
|
+
export { perfectionist };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { findUp } from "../node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.
|
|
2
|
-
import { interopDefault } from "../utils.
|
|
1
|
+
import { findUp } from "../node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js";
|
|
2
|
+
import { interopDefault } from "../utils.js";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
|
-
|
|
5
4
|
//#region src/configs/pnpm.ts
|
|
6
5
|
async function detectCatalogUsage() {
|
|
7
6
|
const workspaceFile = await findUp("pnpm-workspace.yaml");
|
|
@@ -125,6 +124,5 @@ async function pnpm(options) {
|
|
|
125
124
|
});
|
|
126
125
|
return configs;
|
|
127
126
|
}
|
|
128
|
-
|
|
129
127
|
//#endregion
|
|
130
|
-
export { pnpm };
|
|
128
|
+
export { pnpm };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsOverrides, OptionsRegExp, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsOverrides, OptionsRegExp, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/regexp.d.ts
|
|
4
4
|
declare function regexp(options?: OptionsRegExp & OptionsOverrides): TypedFlatConfigItem[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { configs } from "eslint-plugin-regexp";
|
|
2
|
-
|
|
3
2
|
//#region src/configs/regexp.ts
|
|
4
3
|
function regexp(options = {}) {
|
|
5
4
|
const config = configs["flat/recommended"];
|
|
@@ -16,6 +15,5 @@ function regexp(options = {}) {
|
|
|
16
15
|
}
|
|
17
16
|
}];
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
//#endregion
|
|
21
|
-
export { regexp };
|
|
19
|
+
export { regexp };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsOverrides, StylisticConfig, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsOverrides, StylisticConfig, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/stylistic.d.ts
|
|
4
4
|
declare const StylisticConfigDefaults: StylisticConfig;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { interopDefault } from "../utils.
|
|
2
|
-
import { pluginAntfu } from "../plugins.
|
|
3
|
-
|
|
1
|
+
import { interopDefault } from "../utils.js";
|
|
2
|
+
import { pluginAntfu } from "../plugins.js";
|
|
4
3
|
//#region src/configs/stylistic.ts
|
|
5
4
|
const StylisticConfigDefaults = {
|
|
6
5
|
experimental: false,
|
|
@@ -73,6 +72,5 @@ async function stylistic(options = {}) {
|
|
|
73
72
|
}
|
|
74
73
|
}];
|
|
75
74
|
}
|
|
76
|
-
|
|
77
75
|
//#endregion
|
|
78
|
-
export { StylisticConfigDefaults, stylistic };
|
|
76
|
+
export { StylisticConfigDefaults, stylistic };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsFiles, OptionsIsInEditor, OptionsOverrides, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsFiles, OptionsIsInEditor, OptionsOverrides, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/test.d.ts
|
|
4
4
|
declare function test(options?: OptionsFiles & OptionsIsInEditor & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { GLOB_TESTS } from "../globs.
|
|
2
|
-
import { interopDefault } from "../utils.
|
|
3
|
-
|
|
1
|
+
import { GLOB_TESTS } from "../globs.js";
|
|
2
|
+
import { interopDefault } from "../utils.js";
|
|
4
3
|
//#region src/configs/test.ts
|
|
5
4
|
let _pluginTest;
|
|
6
5
|
async function test(options = {}) {
|
|
@@ -37,6 +36,5 @@ async function test(options = {}) {
|
|
|
37
36
|
}
|
|
38
37
|
}];
|
|
39
38
|
}
|
|
40
|
-
|
|
41
39
|
//#endregion
|
|
42
|
-
export { test };
|
|
40
|
+
export { test };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsFiles, OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsFiles, OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/toml.d.ts
|
|
4
4
|
declare function toml(options?: OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { GLOB_TOML } from "../globs.
|
|
2
|
-
import { interopDefault } from "../utils.
|
|
3
|
-
|
|
1
|
+
import { GLOB_TOML } from "../globs.js";
|
|
2
|
+
import { interopDefault } from "../utils.js";
|
|
4
3
|
//#region src/configs/toml.ts
|
|
5
4
|
async function toml(options = {}) {
|
|
6
5
|
const { files = [GLOB_TOML], overrides = {}, stylistic = true } = options;
|
|
@@ -40,6 +39,5 @@ async function toml(options = {}) {
|
|
|
40
39
|
}
|
|
41
40
|
}];
|
|
42
41
|
}
|
|
43
|
-
|
|
44
42
|
//#endregion
|
|
45
|
-
export { toml };
|
|
43
|
+
export { toml };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsComponentExts, OptionsFiles, OptionsOverrides, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescriptWithErasableSyntaxOnly, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsComponentExts, OptionsFiles, OptionsOverrides, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescriptWithErasableSyntaxOnly, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/typescript.d.ts
|
|
4
4
|
declare function typescript(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsTypescriptWithErasableSyntaxOnly & OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ensurePackages, interopDefault } from "../utils.
|
|
3
|
-
import { pluginAntfu } from "../plugins.
|
|
1
|
+
import "../globs.js";
|
|
2
|
+
import { ensurePackages, interopDefault } from "../utils.js";
|
|
3
|
+
import { pluginAntfu } from "../plugins.js";
|
|
4
4
|
import process from "node:process";
|
|
5
|
-
|
|
6
5
|
//#region src/configs/typescript.ts
|
|
7
6
|
async function typescript(options = {}) {
|
|
8
7
|
const { componentExts = [], erasableSyntaxOnly = false, overrides = {}, overridesTypeAware = {}, parserOptions = {}, stylistic = true } = options;
|
|
9
8
|
const files = options.files ?? [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
"**/*.?([cm])ts",
|
|
10
|
+
"**/*.?([cm])tsx",
|
|
11
|
+
"**/*.vue",
|
|
13
12
|
...componentExts.map((ext) => `**/*.${ext}`)
|
|
14
13
|
];
|
|
15
14
|
const filesTypeAware = options.filesTypeAware ?? [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
"**/*.?([cm])ts",
|
|
16
|
+
"**/*.?([cm])tsx",
|
|
17
|
+
"**/*.vue"
|
|
19
18
|
];
|
|
20
|
-
const ignoresTypeAware = options.ignoresTypeAware ?? [
|
|
19
|
+
const ignoresTypeAware = options.ignoresTypeAware ?? [`**/*.md/**`, "**/*.astro/*.ts"];
|
|
21
20
|
const tsconfigPath = options.tsconfigPath ?? void 0;
|
|
22
21
|
const isTypeAware = Boolean(tsconfigPath);
|
|
23
22
|
const isErasableSyntaxOnly = Boolean(erasableSyntaxOnly);
|
|
@@ -236,6 +235,5 @@ async function typescript(options = {}) {
|
|
|
236
235
|
}
|
|
237
236
|
return rules;
|
|
238
237
|
}
|
|
239
|
-
|
|
240
238
|
//#endregion
|
|
241
|
-
export { typescript };
|
|
239
|
+
export { typescript };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { GLOB_SRC } from "../globs.
|
|
2
|
-
import { pluginUnicorn } from "../plugins.
|
|
3
|
-
|
|
1
|
+
import { GLOB_SRC } from "../globs.js";
|
|
2
|
+
import { pluginUnicorn } from "../plugins.js";
|
|
4
3
|
//#region src/configs/unicorn.ts
|
|
5
4
|
function unicorn(options = {}) {
|
|
6
5
|
const { overrides = {} } = options;
|
|
@@ -37,6 +36,5 @@ function unicorn(options = {}) {
|
|
|
37
36
|
rules: { "unicorn/filename-case": ["error", { case: "snakeCase" }] }
|
|
38
37
|
}];
|
|
39
38
|
}
|
|
40
|
-
|
|
41
39
|
//#endregion
|
|
42
|
-
export { unicorn };
|
|
40
|
+
export { unicorn };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsFiles, OptionsHasTypeScript, OptionsOverrides, OptionsStylistic, OptionsVue, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsFiles, OptionsHasTypeScript, OptionsOverrides, OptionsStylistic, OptionsVue, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/vue.d.ts
|
|
4
4
|
declare function vue(options?: OptionsVue & OptionsHasTypeScript & OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { GLOB_SRC, GLOB_VUE } from "../globs.
|
|
2
|
-
import { interopDefault } from "../utils.
|
|
1
|
+
import { GLOB_SRC, GLOB_VUE } from "../globs.js";
|
|
2
|
+
import { interopDefault } from "../utils.js";
|
|
3
3
|
import { mergeProcessors } from "eslint-merge-processors";
|
|
4
|
-
|
|
5
4
|
//#region src/configs/vue.ts
|
|
6
5
|
async function vue(options = {}) {
|
|
7
6
|
const { componentNameInTemplateCasingGlobals = [], componentNameInTemplateCasingIgnores = [], componentNameInTemplateCasingOnlyRegistered = false, files = [GLOB_VUE], overrides = {}, stylistic = true, typescript } = options;
|
|
@@ -206,6 +205,5 @@ async function vue(options = {}) {
|
|
|
206
205
|
}
|
|
207
206
|
];
|
|
208
207
|
}
|
|
209
|
-
|
|
210
208
|
//#endregion
|
|
211
|
-
export { vue };
|
|
209
|
+
export { vue };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsFiles, OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsFiles, OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/yaml.d.ts
|
|
4
4
|
declare function yaml(options?: OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { GLOB_YAML } from "../globs.
|
|
2
|
-
import { interopDefault } from "../utils.
|
|
3
|
-
|
|
1
|
+
import { GLOB_YAML } from "../globs.js";
|
|
2
|
+
import { interopDefault } from "../utils.js";
|
|
4
3
|
//#region src/configs/yaml.ts
|
|
5
4
|
async function yaml(options = {}) {
|
|
6
5
|
const { files = [GLOB_YAML], overrides = {}, stylistic = true } = options;
|
|
@@ -42,6 +41,5 @@ async function yaml(options = {}) {
|
|
|
42
41
|
}
|
|
43
42
|
}];
|
|
44
43
|
}
|
|
45
|
-
|
|
46
44
|
//#endregion
|
|
47
|
-
export { yaml };
|
|
45
|
+
export { yaml };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigNames, RuleOptions } from "./typegen.
|
|
2
|
-
import { OptionsConfig, TypedFlatConfigItem } from "./types.
|
|
1
|
+
import { ConfigNames, RuleOptions } from "./typegen.js";
|
|
2
|
+
import { OptionsConfig, TypedFlatConfigItem } from "./types.js";
|
|
3
3
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
4
4
|
import { Linter } from "eslint";
|
|
5
5
|
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { findUpSync } from "./node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.
|
|
2
|
-
import { interopDefault, isInEditorEnv } from "./utils.
|
|
3
|
-
import { adonisjs } from "./configs/adonisjs.
|
|
4
|
-
import { astro } from "./configs/astro.
|
|
5
|
-
import { command } from "./configs/command.
|
|
6
|
-
import { comments } from "./configs/comments.
|
|
7
|
-
import { disables } from "./configs/disables.
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import "./configs/
|
|
1
|
+
import { findUpSync } from "./node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js";
|
|
2
|
+
import { interopDefault, isInEditorEnv } from "./utils.js";
|
|
3
|
+
import { adonisjs } from "./configs/adonisjs.js";
|
|
4
|
+
import { astro } from "./configs/astro.js";
|
|
5
|
+
import { command } from "./configs/command.js";
|
|
6
|
+
import { comments } from "./configs/comments.js";
|
|
7
|
+
import { disables } from "./configs/disables.js";
|
|
8
|
+
import { e18e } from "./configs/e18e.js";
|
|
9
|
+
import { stylistic } from "./configs/stylistic.js";
|
|
10
|
+
import { formatters } from "./configs/formatters.js";
|
|
11
|
+
import { ignores } from "./configs/ignores.js";
|
|
12
|
+
import { imports } from "./configs/imports.js";
|
|
13
|
+
import { javascript } from "./configs/javascript.js";
|
|
14
|
+
import { jsdoc } from "./configs/jsdoc.js";
|
|
15
|
+
import { jsonc } from "./configs/jsonc.js";
|
|
16
|
+
import { markdown } from "./configs/markdown.js";
|
|
17
|
+
import { node } from "./configs/node.js";
|
|
18
|
+
import { nuxt } from "./configs/nuxt.js";
|
|
19
|
+
import { perfectionist } from "./configs/perfectionist.js";
|
|
20
|
+
import { pnpm } from "./configs/pnpm.js";
|
|
21
|
+
import { regexp } from "./configs/regexp.js";
|
|
22
|
+
import { sortPackageJson, sortTsconfig } from "./configs/sort.js";
|
|
23
|
+
import { test } from "./configs/test.js";
|
|
24
|
+
import { toml } from "./configs/toml.js";
|
|
25
|
+
import { typescript } from "./configs/typescript.js";
|
|
26
|
+
import { unicorn } from "./configs/unicorn.js";
|
|
27
|
+
import { vue } from "./configs/vue.js";
|
|
28
|
+
import { yaml } from "./configs/yaml.js";
|
|
29
|
+
import "./configs/index.js";
|
|
29
30
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
30
31
|
import { isPackageExists } from "local-pkg";
|
|
31
|
-
|
|
32
32
|
//#region src/factory.ts
|
|
33
33
|
const flatConfigProps = [
|
|
34
34
|
"name",
|
|
@@ -51,7 +51,7 @@ const defaultPluginRenaming = {
|
|
|
51
51
|
"yml": "yaml"
|
|
52
52
|
};
|
|
53
53
|
function eienjs(options = {}) {
|
|
54
|
-
const { adonisjs: enableAdonisjs = false, astro: enableAstro = false, componentExts = [], gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJsdoc = true, node: enableNode = true, nuxt: enableNuxt = false, pnpm: enableCatalogs = Boolean(findUpSync("pnpm-workspace.yaml")), regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
54
|
+
const { adonisjs: enableAdonisjs = false, astro: enableAstro = false, componentExts = [], e18e: enableE18e = true, gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJsdoc = true, node: enableNode = true, nuxt: enableNuxt = false, pnpm: enableCatalogs = Boolean(findUpSync("pnpm-workspace.yaml")), regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
55
55
|
let { isInEditor } = options;
|
|
56
56
|
if (isInEditor == null) {
|
|
57
57
|
isInEditor = isInEditorEnv();
|
|
@@ -78,6 +78,10 @@ function eienjs(options = {}) {
|
|
|
78
78
|
stylistic: stylisticOptions,
|
|
79
79
|
...resolveSubOptions(options, "imports")
|
|
80
80
|
}));
|
|
81
|
+
if (enableE18e) configs.push(e18e({
|
|
82
|
+
isInEditor,
|
|
83
|
+
...enableE18e === true ? {} : enableE18e
|
|
84
|
+
}));
|
|
81
85
|
if (enableUnicorn) configs.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
|
|
82
86
|
if (enableVue) componentExts.push("vue");
|
|
83
87
|
if (enableTypeScript) configs.push(typescript({
|
|
@@ -167,6 +171,5 @@ function getOverrides(options, key) {
|
|
|
167
171
|
const sub = resolveSubOptions(options, key);
|
|
168
172
|
return { ..."overrides" in sub ? sub.overrides : {} };
|
|
169
173
|
}
|
|
170
|
-
|
|
171
174
|
//#endregion
|
|
172
|
-
export { defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions };
|
|
175
|
+
export { defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions };
|
|
@@ -85,6 +85,5 @@ const GLOB_EXCLUDE = [
|
|
|
85
85
|
"**/components.d.ts",
|
|
86
86
|
"**/tests/_files"
|
|
87
87
|
];
|
|
88
|
-
|
|
89
88
|
//#endregion
|
|
90
|
-
export { 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 };
|
|
89
|
+
export { 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 };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
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 { Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, 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, OptionsAdonisJS, OptionsComponentExts, OptionsConfig, OptionsE18e, OptionsErasableSyntaxOnly, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsMarkdown, OptionsNuxt, OptionsOverrides, OptionsPnpm, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsTypescriptWithErasableSyntaxOnly, OptionsVue, ResolvedOptions, RuleOptions, Rules, StylisticConfig, TypedFlatConfigItem, combine, eienjs as default, defaultPluginRenaming, eienjs, ensurePackages, getOverrides, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, resolveSubOptions, toArray };
|
|
@@ -1,10 +1,8 @@
|
|
|
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.
|
|
2
|
-
import { combine, ensurePackages, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, toArray } from "./utils.
|
|
3
|
-
import { defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions } from "./factory.
|
|
4
|
-
import { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON } from "./config_presets.
|
|
5
|
-
|
|
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";
|
|
6
5
|
//#region src/index.ts
|
|
7
6
|
var src_default = eienjs;
|
|
8
|
-
|
|
9
7
|
//#endregion
|
|
10
|
-
export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, 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, combine, src_default as default, defaultPluginRenaming, eienjs, ensurePackages, getOverrides, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, resolveSubOptions, toArray };
|
|
8
|
+
export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, 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, combine, src_default as default, defaultPluginRenaming, eienjs, ensurePackages, getOverrides, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, resolveSubOptions, toArray };
|
|
@@ -3,7 +3,6 @@ import fsp from "node:fs/promises";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
|
|
7
6
|
//#region node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js
|
|
8
7
|
const toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
|
|
9
8
|
async function findUp(name, { cwd = process.cwd(), type = "file", stopAt } = {}) {
|
|
@@ -36,6 +35,5 @@ function findUpSync(name, { cwd = process.cwd(), type = "file", stopAt } = {}) {
|
|
|
36
35
|
directory = path.dirname(directory);
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
|
-
|
|
40
38
|
//#endregion
|
|
41
|
-
export { findUp, findUpSync };
|
|
39
|
+
export { findUp, findUpSync };
|
package/dist/package.js
ADDED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import pluginE18e from "@e18e/eslint-plugin";
|
|
1
2
|
import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
2
3
|
import pluginAntfu from "eslint-plugin-antfu";
|
|
3
4
|
import pluginImportLite from "eslint-plugin-import-lite";
|
|
@@ -5,5 +6,4 @@ import pluginNode from "eslint-plugin-n";
|
|
|
5
6
|
import pluginPerfectionist from "eslint-plugin-perfectionist";
|
|
6
7
|
import pluginUnicorn from "eslint-plugin-unicorn";
|
|
7
8
|
import pluginUnusedImports from "eslint-plugin-unused-imports";
|
|
8
|
-
|
|
9
|
-
export { pluginAntfu, pluginComments, pluginImportLite, pluginNode, pluginPerfectionist, pluginUnicorn, pluginUnusedImports };
|
|
9
|
+
export { pluginAntfu, pluginComments, pluginE18e, pluginImportLite, pluginNode, pluginPerfectionist, pluginUnicorn, pluginUnusedImports };
|