@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
package/bin/index.js
ADDED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import c from "ansis";
|
|
2
|
-
|
|
3
2
|
//#region src/cli/constants.ts
|
|
4
3
|
const vscodeSettingsString = `
|
|
5
4
|
// Disable the default formatter, use eslint instead
|
|
@@ -69,6 +68,5 @@ const dependenciesMap = {
|
|
|
69
68
|
nuxt: ["@nuxt/eslint-plugin"],
|
|
70
69
|
vue: []
|
|
71
70
|
};
|
|
72
|
-
|
|
73
71
|
//#endregion
|
|
74
|
-
export { dependenciesMap, extra, extraOptions, frameworkOptions, frameworks, vscodeSettingsString };
|
|
72
|
+
export { dependenciesMap, extra, extraOptions, frameworkOptions, frameworks, vscodeSettingsString };
|
|
@@ -3,11 +3,10 @@ const versionsMap = {
|
|
|
3
3
|
"@adonisjs/eslint-plugin": "^2.2.2",
|
|
4
4
|
"@nuxt/eslint-plugin": "^1.15.2",
|
|
5
5
|
"astro-eslint-parser": "^1.3.0",
|
|
6
|
-
"eslint": "^10.0.
|
|
6
|
+
"eslint": "^10.0.3",
|
|
7
7
|
"eslint-plugin-astro": "^1.6.0",
|
|
8
8
|
"eslint-plugin-format": "^2.0.1",
|
|
9
9
|
"prettier-plugin-astro": "^0.14.1"
|
|
10
10
|
};
|
|
11
|
-
|
|
12
11
|
//#endregion
|
|
13
|
-
export { versionsMap };
|
|
12
|
+
export { versionsMap };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { version } from "../package.
|
|
2
|
-
import { run } from "./run.
|
|
1
|
+
import { version } from "../package.js";
|
|
2
|
+
import { run } from "./run.js";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import * as p from "@clack/prompts";
|
|
5
5
|
import c from "ansis";
|
|
6
6
|
import { cac } from "cac";
|
|
7
|
-
|
|
8
7
|
//#region src/cli/index.ts
|
|
9
8
|
function header() {
|
|
10
9
|
console.log("\n");
|
|
@@ -24,6 +23,5 @@ cli.command("", "Run the initialization or migration").option("--yes, -y", "Skip
|
|
|
24
23
|
cli.help();
|
|
25
24
|
cli.version(version);
|
|
26
25
|
cli.parse();
|
|
27
|
-
|
|
28
26
|
//#endregion
|
|
29
|
-
export {
|
|
27
|
+
export {};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { extra, extraOptions, frameworkOptions, frameworks } from "./constants.
|
|
2
|
-
import { isGitClean } from "./utils.
|
|
3
|
-
import { updateEslintFiles } from "./stages/update_eslint_files.
|
|
4
|
-
import { updatePackageJson } from "./stages/update_package_json.
|
|
5
|
-
import { updateVscodeSettings } from "./stages/update_vscode_settings.
|
|
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";
|
|
6
6
|
import process from "node:process";
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import * as p from "@clack/prompts";
|
|
10
10
|
import c from "ansis";
|
|
11
|
-
|
|
12
11
|
//#region src/cli/run.ts
|
|
13
12
|
async function run(options = {}) {
|
|
14
13
|
const argSkipPrompt = Boolean(process.env.SKIP_PROMPT) || options.yes;
|
|
@@ -72,6 +71,5 @@ async function run(options = {}) {
|
|
|
72
71
|
p.log.success(c.green`Setup completed`);
|
|
73
72
|
p.outro(`Now you can update the dependencies by run ${c.blue("pnpm install")} and run ${c.blue("eslint --fix")}\n`);
|
|
74
73
|
}
|
|
75
|
-
|
|
76
74
|
//#endregion
|
|
77
|
-
export { run };
|
|
75
|
+
export { run };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getEslintConfigContent } from "../utils.
|
|
1
|
+
import { getEslintConfigContent } from "../utils.js";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import fsp from "node:fs/promises";
|
|
4
4
|
import fs from "node:fs";
|
|
@@ -6,8 +6,8 @@ import path from "node:path";
|
|
|
6
6
|
import * as p from "@clack/prompts";
|
|
7
7
|
import c from "ansis";
|
|
8
8
|
import parse from "parse-gitignore";
|
|
9
|
-
|
|
10
9
|
//#region src/cli/stages/update_eslint_files.ts
|
|
10
|
+
const ESLINT_OR_PRETTIER = /eslint|prettier/;
|
|
11
11
|
async function updateEslintFiles(result) {
|
|
12
12
|
const cwd = process.cwd();
|
|
13
13
|
const pathESLintIgnore = path.join(cwd, ".eslintignore");
|
|
@@ -31,9 +31,8 @@ async function updateEslintFiles(result) {
|
|
|
31
31
|
p.log.success(c.green`Created ${configFileName}`);
|
|
32
32
|
const files = fs.readdirSync(cwd);
|
|
33
33
|
const legacyConfig = [];
|
|
34
|
-
for (const file of files) if (
|
|
34
|
+
for (const file of files) if (ESLINT_OR_PRETTIER.test(file) && !file.includes("eslint.config.")) legacyConfig.push(file);
|
|
35
35
|
if (legacyConfig.length > 0) p.note(c.dim(legacyConfig.join(", ")), "You can now remove those files manually");
|
|
36
36
|
}
|
|
37
|
-
|
|
38
37
|
//#endregion
|
|
39
|
-
export { updateEslintFiles };
|
|
38
|
+
export { updateEslintFiles };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { version } from "../../package.
|
|
2
|
-
import { dependenciesMap } from "../constants.
|
|
3
|
-
import { versionsMap } from "../constants_generated.
|
|
1
|
+
import { version } from "../../package.js";
|
|
2
|
+
import { dependenciesMap } from "../constants.js";
|
|
3
|
+
import { versionsMap } from "../constants_generated.js";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import fsp from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import * as p from "@clack/prompts";
|
|
8
8
|
import c from "ansis";
|
|
9
|
-
|
|
10
9
|
//#region src/cli/stages/update_package_json.ts
|
|
11
10
|
async function updatePackageJson(result) {
|
|
12
11
|
const cwd = process.cwd();
|
|
@@ -41,6 +40,5 @@ async function updatePackageJson(result) {
|
|
|
41
40
|
await fsp.writeFile(pathPackageJSON, JSON.stringify(pkg, null, 2));
|
|
42
41
|
p.log.success(c.green`Changes wrote to package.json`);
|
|
43
42
|
}
|
|
44
|
-
|
|
45
43
|
//#endregion
|
|
46
|
-
export { updatePackageJson };
|
|
44
|
+
export { updatePackageJson };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { vscodeSettingsString } from "../constants.
|
|
1
|
+
import { vscodeSettingsString } from "../constants.js";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import fsp from "node:fs/promises";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import * as p from "@clack/prompts";
|
|
7
7
|
import { green } from "ansis";
|
|
8
|
-
|
|
9
8
|
//#region src/cli/stages/update_vscode_settings.ts
|
|
9
|
+
const LAST_LINE_PATTERN = /\s*\}$/;
|
|
10
10
|
async function updateVscodeSettings(result) {
|
|
11
11
|
const cwd = process.cwd();
|
|
12
12
|
if (!result.updateVscodeSettings) return;
|
|
@@ -15,7 +15,7 @@ async function updateVscodeSettings(result) {
|
|
|
15
15
|
if (!fs.existsSync(dotVscodePath)) await fsp.mkdir(dotVscodePath, { recursive: true });
|
|
16
16
|
if (fs.existsSync(settingsPath)) {
|
|
17
17
|
let settingsContent = await fsp.readFile(settingsPath, "utf8");
|
|
18
|
-
settingsContent = settingsContent.trim().replace(
|
|
18
|
+
settingsContent = settingsContent.trim().replace(LAST_LINE_PATTERN, "");
|
|
19
19
|
settingsContent += settingsContent.endsWith(",") || settingsContent.endsWith("{") ? "" : ",";
|
|
20
20
|
settingsContent += `${vscodeSettingsString}}\n`;
|
|
21
21
|
await fsp.writeFile(settingsPath, settingsContent, "utf8");
|
|
@@ -25,6 +25,5 @@ async function updateVscodeSettings(result) {
|
|
|
25
25
|
p.log.success(green`Created .vscode/settings.json`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
|
|
29
28
|
//#endregion
|
|
30
|
-
export { updateVscodeSettings };
|
|
29
|
+
export { updateVscodeSettings };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { execSync } from "node:child_process";
|
|
2
|
-
|
|
3
2
|
//#region src/cli/utils.ts
|
|
4
3
|
function isGitClean() {
|
|
5
4
|
try {
|
|
@@ -18,6 +17,5 @@ ${mainConfig}
|
|
|
18
17
|
});
|
|
19
18
|
`.trimStart();
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
//#endregion
|
|
23
|
-
export { getEslintConfigContent, isGitClean };
|
|
21
|
+
export { getEslintConfigContent, isGitClean };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { GLOB_SRC_EXT } from "../globs.
|
|
2
|
-
import { ensurePackages, interopDefault } from "../utils.
|
|
1
|
+
import { GLOB_SRC_EXT } from "../globs.js";
|
|
2
|
+
import { ensurePackages, interopDefault } from "../utils.js";
|
|
3
3
|
import { join } from "pathe";
|
|
4
|
-
|
|
5
4
|
//#region src/configs/adonisjs.ts
|
|
6
5
|
async function adonisjs(options = {}) {
|
|
7
6
|
const { dirs = {}, overrides = {} } = options;
|
|
@@ -147,6 +146,5 @@ async function adonisjs(options = {}) {
|
|
|
147
146
|
}
|
|
148
147
|
];
|
|
149
148
|
}
|
|
150
|
-
|
|
151
149
|
//#endregion
|
|
152
|
-
export { adonisjs };
|
|
150
|
+
export { adonisjs };
|
|
@@ -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/astro.d.ts
|
|
4
4
|
declare function astro(options?: OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { GLOB_ASTRO } from "../globs.
|
|
2
|
-
import { interopDefault } from "../utils.
|
|
3
|
-
|
|
1
|
+
import { GLOB_ASTRO } from "../globs.js";
|
|
2
|
+
import { interopDefault } from "../utils.js";
|
|
4
3
|
//#region src/configs/astro.ts
|
|
5
4
|
async function astro(options = {}) {
|
|
6
5
|
const { files = [GLOB_ASTRO], overrides = {}, stylistic = true } = options;
|
|
@@ -47,6 +46,5 @@ async function astro(options = {}) {
|
|
|
47
46
|
}
|
|
48
47
|
}];
|
|
49
48
|
}
|
|
50
|
-
|
|
51
49
|
//#endregion
|
|
52
|
-
export { astro };
|
|
50
|
+
export { astro };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import createCommand from "eslint-plugin-command/config";
|
|
2
|
-
|
|
3
2
|
//#region src/configs/command.ts
|
|
4
3
|
function command() {
|
|
5
4
|
return [{
|
|
@@ -7,6 +6,5 @@ function command() {
|
|
|
7
6
|
name: "eienjs/command/rules"
|
|
8
7
|
}];
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
//#endregion
|
|
12
|
-
export { command };
|
|
10
|
+
export { command };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { pluginComments } from "../plugins.
|
|
2
|
-
|
|
1
|
+
import { pluginComments } from "../plugins.js";
|
|
3
2
|
//#region src/configs/comments.ts
|
|
4
3
|
function comments() {
|
|
5
4
|
return [{
|
|
@@ -14,6 +13,5 @@ function comments() {
|
|
|
14
13
|
}
|
|
15
14
|
}];
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
//#endregion
|
|
19
|
-
export { comments };
|
|
17
|
+
export { comments };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { GLOB_ASTRO, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_SRC, GLOB_SRC_EXT, GLOB_TOML, GLOB_YAML } from "../globs.
|
|
2
|
-
|
|
1
|
+
import { GLOB_ASTRO, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_SRC, GLOB_SRC_EXT, GLOB_TOML, GLOB_YAML } from "../globs.js";
|
|
3
2
|
//#region src/configs/disables.ts
|
|
4
3
|
function disables() {
|
|
5
4
|
return [
|
|
@@ -89,6 +88,5 @@ function disables() {
|
|
|
89
88
|
}
|
|
90
89
|
];
|
|
91
90
|
}
|
|
92
|
-
|
|
93
91
|
//#endregion
|
|
94
|
-
export { disables };
|
|
92
|
+
export { disables };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { pluginE18e } from "../plugins.js";
|
|
2
|
+
//#region src/configs/e18e.ts
|
|
3
|
+
function e18e(options = {}) {
|
|
4
|
+
const { isInEditor = false, modernization = true, moduleReplacements = isInEditor, overrides = {}, performanceImprovements = true } = options;
|
|
5
|
+
const configs = pluginE18e.configs;
|
|
6
|
+
return [{
|
|
7
|
+
name: "eienjs/e18e/setup",
|
|
8
|
+
plugins: { e18e: pluginE18e }
|
|
9
|
+
}, {
|
|
10
|
+
name: "eienjs/e18e/rules",
|
|
11
|
+
rules: {
|
|
12
|
+
...modernization ? { ...configs.modernization.rules } : {},
|
|
13
|
+
...moduleReplacements ? { ...configs.moduleReplacements.rules } : {},
|
|
14
|
+
...performanceImprovements ? { ...configs.performanceImprovements.rules } : {},
|
|
15
|
+
...overrides
|
|
16
|
+
}
|
|
17
|
+
}];
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { e18e };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsFormatters, StylisticConfig, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsFormatters, StylisticConfig, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/formatters.d.ts
|
|
4
4
|
declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<TypedFlatConfigItem[]>;
|
|
@@ -1,7 +1,6 @@
|
|
|
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.
|
|
2
|
-
import { ensurePackages, interopDefault, isPackageInScope, parserPlain } from "../utils.
|
|
3
|
-
import { StylisticConfigDefaults } from "./stylistic.
|
|
4
|
-
|
|
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";
|
|
5
4
|
//#region src/configs/formatters.ts
|
|
6
5
|
function mergePrettierOptions(options, overrides) {
|
|
7
6
|
return {
|
|
@@ -129,6 +128,5 @@ async function formatters(options = {}, stylistic = {}) {
|
|
|
129
128
|
});
|
|
130
129
|
return configs;
|
|
131
130
|
}
|
|
132
|
-
|
|
133
131
|
//#endregion
|
|
134
|
-
export { formatters };
|
|
132
|
+
export { formatters };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/ignores.d.ts
|
|
4
4
|
declare function ignores(userIgnores?: string[] | ((originals: string[]) => string[]), ignoreTypescript?: boolean): TypedFlatConfigItem[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { GLOB_EXCLUDE, GLOB_TS, GLOB_TSX } from "../globs.
|
|
2
|
-
|
|
1
|
+
import { GLOB_EXCLUDE, GLOB_TS, GLOB_TSX } from "../globs.js";
|
|
3
2
|
//#region src/configs/ignores.ts
|
|
4
3
|
function ignores(userIgnores = [], ignoreTypescript = false) {
|
|
5
4
|
let ignores = [...GLOB_EXCLUDE];
|
|
@@ -10,6 +9,5 @@ function ignores(userIgnores = [], ignoreTypescript = false) {
|
|
|
10
9
|
name: "eienjs/ignores"
|
|
11
10
|
}];
|
|
12
11
|
}
|
|
13
|
-
|
|
14
12
|
//#endregion
|
|
15
|
-
export { ignores };
|
|
13
|
+
export { ignores };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/imports.d.ts
|
|
4
4
|
declare function imports(options?: OptionsOverrides & OptionsStylistic): TypedFlatConfigItem[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { pluginAntfu, pluginImportLite } from "../plugins.
|
|
2
|
-
|
|
1
|
+
import { pluginAntfu, pluginImportLite } from "../plugins.js";
|
|
3
2
|
//#region src/configs/imports.ts
|
|
4
3
|
function imports(options = {}) {
|
|
5
4
|
const { overrides = {}, stylistic = true } = options;
|
|
@@ -23,6 +22,5 @@ function imports(options = {}) {
|
|
|
23
22
|
}
|
|
24
23
|
}];
|
|
25
24
|
}
|
|
26
|
-
|
|
27
25
|
//#endregion
|
|
28
|
-
export { imports };
|
|
26
|
+
export { imports };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { adonisjs } from "./adonisjs.js";
|
|
2
|
+
import { astro } from "./astro.js";
|
|
3
|
+
import { command } from "./command.js";
|
|
4
|
+
import { comments } from "./comments.js";
|
|
5
|
+
import { disables } from "./disables.js";
|
|
6
|
+
import { e18e } from "./e18e.js";
|
|
7
|
+
import { formatters } from "./formatters.js";
|
|
8
|
+
import { ignores } from "./ignores.js";
|
|
9
|
+
import { imports } from "./imports.js";
|
|
10
|
+
import { javascript } from "./javascript.js";
|
|
11
|
+
import { jsdoc } from "./jsdoc.js";
|
|
12
|
+
import { jsonc } from "./jsonc.js";
|
|
13
|
+
import { markdown } from "./markdown.js";
|
|
14
|
+
import { node } from "./node.js";
|
|
15
|
+
import { nuxt } from "./nuxt.js";
|
|
16
|
+
import { perfectionist } from "./perfectionist.js";
|
|
17
|
+
import { pnpm } from "./pnpm.js";
|
|
18
|
+
import { regexp } from "./regexp.js";
|
|
19
|
+
import { sortPackageJson, sortTsconfig } from "./sort.js";
|
|
20
|
+
import { StylisticConfigDefaults, StylisticOptions, stylistic } from "./stylistic.js";
|
|
21
|
+
import { test } from "./test.js";
|
|
22
|
+
import { toml } from "./toml.js";
|
|
23
|
+
import { typescript } from "./typescript.js";
|
|
24
|
+
import { unicorn } from "./unicorn.js";
|
|
25
|
+
import { vue } from "./vue.js";
|
|
26
|
+
import { yaml } from "./yaml.js";
|
|
27
|
+
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,27 @@
|
|
|
1
|
+
import { adonisjs } from "./adonisjs.js";
|
|
2
|
+
import { astro } from "./astro.js";
|
|
3
|
+
import { command } from "./command.js";
|
|
4
|
+
import { comments } from "./comments.js";
|
|
5
|
+
import { disables } from "./disables.js";
|
|
6
|
+
import { e18e } from "./e18e.js";
|
|
7
|
+
import { StylisticConfigDefaults, stylistic } from "./stylistic.js";
|
|
8
|
+
import { formatters } from "./formatters.js";
|
|
9
|
+
import { ignores } from "./ignores.js";
|
|
10
|
+
import { imports } from "./imports.js";
|
|
11
|
+
import { javascript } from "./javascript.js";
|
|
12
|
+
import { jsdoc } from "./jsdoc.js";
|
|
13
|
+
import { jsonc } from "./jsonc.js";
|
|
14
|
+
import { markdown } from "./markdown.js";
|
|
15
|
+
import { node } from "./node.js";
|
|
16
|
+
import { nuxt } from "./nuxt.js";
|
|
17
|
+
import { perfectionist } from "./perfectionist.js";
|
|
18
|
+
import { pnpm } from "./pnpm.js";
|
|
19
|
+
import { regexp } from "./regexp.js";
|
|
20
|
+
import { sortPackageJson, sortTsconfig } from "./sort.js";
|
|
21
|
+
import { test } from "./test.js";
|
|
22
|
+
import { toml } from "./toml.js";
|
|
23
|
+
import { typescript } from "./typescript.js";
|
|
24
|
+
import { unicorn } from "./unicorn.js";
|
|
25
|
+
import { vue } from "./vue.js";
|
|
26
|
+
import { yaml } from "./yaml.js";
|
|
27
|
+
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,4 @@
|
|
|
1
|
-
import { OptionsIsInEditor, OptionsOverrides, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsIsInEditor, OptionsOverrides, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/javascript.d.ts
|
|
4
4
|
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): TypedFlatConfigItem[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { pluginAntfu, pluginUnusedImports } from "../plugins.
|
|
1
|
+
import { pluginAntfu, pluginUnusedImports } from "../plugins.js";
|
|
2
2
|
import globals from "globals";
|
|
3
|
-
|
|
4
3
|
//#region src/configs/javascript.ts
|
|
5
4
|
function javascript(options = {}) {
|
|
6
5
|
const { isInEditor = false, overrides = {} } = options;
|
|
@@ -283,6 +282,5 @@ function javascript(options = {}) {
|
|
|
283
282
|
}
|
|
284
283
|
}];
|
|
285
284
|
}
|
|
286
|
-
|
|
287
285
|
//#endregion
|
|
288
|
-
export { javascript };
|
|
286
|
+
export { javascript };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { GLOB_SRC } from "../globs.
|
|
2
|
-
import { interopDefault } from "../utils.
|
|
3
|
-
|
|
1
|
+
import { GLOB_SRC } from "../globs.js";
|
|
2
|
+
import { interopDefault } from "../utils.js";
|
|
4
3
|
//#region src/configs/jsdoc.ts
|
|
5
4
|
async function jsdoc(options = {}) {
|
|
6
5
|
const { stylistic = true } = options;
|
|
@@ -33,6 +32,5 @@ async function jsdoc(options = {}) {
|
|
|
33
32
|
}
|
|
34
33
|
}];
|
|
35
34
|
}
|
|
36
|
-
|
|
37
35
|
//#endregion
|
|
38
|
-
export { jsdoc };
|
|
36
|
+
export { jsdoc };
|
|
@@ -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/jsonc.d.ts
|
|
4
4
|
declare function jsonc(options?: OptionsFiles & OptionsStylistic & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { GLOB_JSON, GLOB_JSON5, GLOB_JSONC } from "../globs.
|
|
2
|
-
import { interopDefault } from "../utils.
|
|
3
|
-
|
|
1
|
+
import { GLOB_JSON, GLOB_JSON5, GLOB_JSONC } from "../globs.js";
|
|
2
|
+
import { interopDefault } from "../utils.js";
|
|
4
3
|
//#region src/configs/jsonc.ts
|
|
5
4
|
async function jsonc(options = {}) {
|
|
6
5
|
const { files = [
|
|
@@ -65,6 +64,5 @@ async function jsonc(options = {}) {
|
|
|
65
64
|
}
|
|
66
65
|
}];
|
|
67
66
|
}
|
|
68
|
-
|
|
69
67
|
//#endregion
|
|
70
|
-
export { jsonc };
|
|
68
|
+
export { jsonc };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsComponentExts, OptionsFiles, OptionsMarkdown, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsComponentExts, OptionsFiles, OptionsMarkdown, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/markdown.d.ts
|
|
4
4
|
declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsMarkdown): Promise<TypedFlatConfigItem[]>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN } from "../globs.
|
|
2
|
-
import { interopDefault } from "../utils.
|
|
1
|
+
import { GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN } from "../globs.js";
|
|
2
|
+
import { interopDefault } from "../utils.js";
|
|
3
3
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
4
|
-
|
|
5
4
|
//#region src/configs/markdown.ts
|
|
6
5
|
async function markdown(options = {}) {
|
|
7
6
|
const { componentExts = [], files = [GLOB_MARKDOWN], gfm = true, overrides = {}, overridesMarkdown = {} } = options;
|
|
@@ -27,6 +26,7 @@ async function markdown(options = {}) {
|
|
|
27
26
|
name: "eienjs/markdown/rules",
|
|
28
27
|
rules: {
|
|
29
28
|
...markdown.configs.recommended.at(0)?.rules,
|
|
29
|
+
"markdown/fenced-code-language": "off",
|
|
30
30
|
"markdown/no-missing-label-refs": "off",
|
|
31
31
|
...overridesMarkdown
|
|
32
32
|
}
|
|
@@ -86,6 +86,5 @@ async function markdown(options = {}) {
|
|
|
86
86
|
}
|
|
87
87
|
];
|
|
88
88
|
}
|
|
89
|
-
|
|
90
89
|
//#endregion
|
|
91
|
-
export { markdown };
|
|
90
|
+
export { markdown };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { GLOB_SRC } from "../globs.
|
|
2
|
-
import { pluginNode } from "../plugins.
|
|
3
|
-
|
|
1
|
+
import { GLOB_SRC } from "../globs.js";
|
|
2
|
+
import { pluginNode } from "../plugins.js";
|
|
4
3
|
//#region src/configs/node.ts
|
|
5
4
|
function node() {
|
|
6
5
|
return [{
|
|
@@ -21,6 +20,5 @@ function node() {
|
|
|
21
20
|
}
|
|
22
21
|
}];
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
//#endregion
|
|
26
|
-
export { node };
|
|
24
|
+
export { node };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsNuxt, OptionsStylistic, TypedFlatConfigItem } from "../types.
|
|
1
|
+
import { OptionsNuxt, OptionsStylistic, TypedFlatConfigItem } from "../types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/nuxt.d.ts
|
|
4
4
|
declare function nuxt(options?: OptionsNuxt & OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { GLOB_EXTS, GLOB_SRC, GLOB_VUE } from "../globs.
|
|
2
|
-
import { ensurePackages, interopDefault } from "../utils.
|
|
1
|
+
import { GLOB_EXTS, GLOB_SRC, GLOB_VUE } from "../globs.js";
|
|
2
|
+
import { ensurePackages, interopDefault } from "../utils.js";
|
|
3
3
|
import { join } from "pathe";
|
|
4
|
-
|
|
5
4
|
//#region src/configs/nuxt.ts
|
|
6
5
|
async function nuxt(options = {}) {
|
|
7
6
|
const { dirs = {}, overrides = {}, stylistic = true, version = 4 } = options;
|
|
@@ -132,6 +131,5 @@ async function nuxt(options = {}) {
|
|
|
132
131
|
}] : []
|
|
133
132
|
];
|
|
134
133
|
}
|
|
135
|
-
|
|
136
134
|
//#endregion
|
|
137
|
-
export { nuxt };
|
|
135
|
+
export { nuxt };
|