@luxass/eslint-config 4.19.0 → 5.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.
- package/README.md +1 -0
- package/dist/index.d.ts +309 -195
- package/dist/index.js +21 -17
- package/package.json +23 -22
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import process from "node:process";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
|
|
6
6
|
import pluginAntfu from "eslint-plugin-antfu";
|
|
7
|
+
import pluginImportLite from "eslint-plugin-import-lite";
|
|
7
8
|
import pluginUnusedImports from "eslint-plugin-unused-imports";
|
|
8
9
|
import globals from "globals";
|
|
9
10
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
@@ -472,19 +473,6 @@ async function stylistic(options = {}) {
|
|
|
472
473
|
after: true,
|
|
473
474
|
before: false
|
|
474
475
|
}],
|
|
475
|
-
"style/padding-line-between-statements": [
|
|
476
|
-
"error",
|
|
477
|
-
{
|
|
478
|
-
blankLine: "always",
|
|
479
|
-
next: "*",
|
|
480
|
-
prev: "import"
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
blankLine: "any",
|
|
484
|
-
next: "import",
|
|
485
|
-
prev: "import"
|
|
486
|
-
}
|
|
487
|
-
],
|
|
488
476
|
"style/yield-star-spacing": ["error", {
|
|
489
477
|
after: true,
|
|
490
478
|
before: false
|
|
@@ -601,14 +589,25 @@ async function ignores(userIgnores = []) {
|
|
|
601
589
|
|
|
602
590
|
//#endregion
|
|
603
591
|
//#region src/configs/imports.ts
|
|
604
|
-
async function imports(
|
|
592
|
+
async function imports(options = {}) {
|
|
593
|
+
const { overrides = {}, stylistic: stylistic$1 = true } = options;
|
|
605
594
|
return [{
|
|
606
595
|
name: "luxass/imports",
|
|
607
|
-
plugins: {
|
|
596
|
+
plugins: {
|
|
597
|
+
antfu: pluginAntfu,
|
|
598
|
+
import: pluginImportLite
|
|
599
|
+
},
|
|
608
600
|
rules: {
|
|
609
601
|
"antfu/import-dedupe": "error",
|
|
610
602
|
"antfu/no-import-dist": "error",
|
|
611
|
-
"antfu/no-import-node-modules-by-path": "error"
|
|
603
|
+
"antfu/no-import-node-modules-by-path": "error",
|
|
604
|
+
"import/consistent-type-specifier-style": ["error", "top-level"],
|
|
605
|
+
"import/first": "error",
|
|
606
|
+
"import/no-duplicates": "error",
|
|
607
|
+
"import/no-mutable-exports": "error",
|
|
608
|
+
"import/no-named-default": "error",
|
|
609
|
+
...stylistic$1 ? { "import/newline-after-import": ["error", { count: 1 }] } : {},
|
|
610
|
+
...overrides
|
|
612
611
|
}
|
|
613
612
|
}];
|
|
614
613
|
}
|
|
@@ -2084,6 +2083,7 @@ const defaultPluginRenaming = {
|
|
|
2084
2083
|
"@eslint-react/naming-convention": "react-naming-convention",
|
|
2085
2084
|
"@stylistic": "style",
|
|
2086
2085
|
"@typescript-eslint": "ts",
|
|
2086
|
+
"import-lite": "import",
|
|
2087
2087
|
"n": "node",
|
|
2088
2088
|
"vitest": "test",
|
|
2089
2089
|
"yml": "yaml"
|
|
@@ -2099,7 +2099,7 @@ const defaultPluginRenaming = {
|
|
|
2099
2099
|
* The merged ESLint configurations.
|
|
2100
2100
|
*/
|
|
2101
2101
|
function luxass(options = {}, ...userConfigs) {
|
|
2102
|
-
const { astro: enableAstro = false, autoRenamePlugins = true, exts = [], gitignore: enableGitignore = true, jsx: enableJsx = true, pnpm: enableCatalogs = false, react: enableReact = false, regexp: enableRegexp = true, tailwindcss: enableTailwindCSS = false, type: projectType = "app", typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
2102
|
+
const { astro: enableAstro = false, autoRenamePlugins = true, exts = [], gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true, pnpm: enableCatalogs = false, react: enableReact = false, regexp: enableRegexp = true, tailwindcss: enableTailwindCSS = false, type: projectType = "app", typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
2103
2103
|
let isInEditor = options.isInEditor;
|
|
2104
2104
|
if (isInEditor == null) {
|
|
2105
2105
|
isInEditor = isInEditorEnv();
|
|
@@ -2122,6 +2122,10 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2122
2122
|
isInEditor,
|
|
2123
2123
|
overrides: getOverrides(options, "javascript")
|
|
2124
2124
|
}), comments(), node(), jsdoc({ stylistic: stylisticOptions }), imports({ stylistic: stylisticOptions }), perfectionist());
|
|
2125
|
+
if (enableImports) configs$1.push(imports(enableImports === true ? { stylistic: stylisticOptions } : {
|
|
2126
|
+
stylistic: stylisticOptions,
|
|
2127
|
+
...enableImports
|
|
2128
|
+
}));
|
|
2125
2129
|
if (enableUnicorn) configs$1.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
|
|
2126
2130
|
if (enableVue) exts.push("vue");
|
|
2127
2131
|
if (enableJsx) configs$1.push(jsx());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxass/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "ESLint config for @luxass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -83,58 +83,59 @@
|
|
|
83
83
|
"@antfu/install-pkg": "^1.1.0",
|
|
84
84
|
"@clack/prompts": "^0.11.0",
|
|
85
85
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
86
|
-
"@eslint/markdown": "^6.
|
|
87
|
-
"@stylistic/eslint-plugin": "^
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
89
|
-
"@typescript-eslint/parser": "^8.
|
|
90
|
-
"@vitest/eslint-plugin": "^1.
|
|
86
|
+
"@eslint/markdown": "^6.6.0",
|
|
87
|
+
"@stylistic/eslint-plugin": "^5.1.0",
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "^8.35.1",
|
|
89
|
+
"@typescript-eslint/parser": "^8.35.1",
|
|
90
|
+
"@vitest/eslint-plugin": "^1.3.4",
|
|
91
91
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
92
92
|
"eslint-flat-config-utils": "^2.1.0",
|
|
93
93
|
"eslint-merge-processors": "^2.0.0",
|
|
94
94
|
"eslint-plugin-antfu": "^3.1.1",
|
|
95
|
-
"eslint-plugin-
|
|
95
|
+
"eslint-plugin-import-lite": "^0.3.0",
|
|
96
|
+
"eslint-plugin-jsdoc": "^51.3.2",
|
|
96
97
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
97
|
-
"eslint-plugin-n": "^17.
|
|
98
|
-
"eslint-plugin-perfectionist": "^4.
|
|
98
|
+
"eslint-plugin-n": "^17.20.0",
|
|
99
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
99
100
|
"eslint-plugin-pnpm": "^0.3.1",
|
|
100
|
-
"eslint-plugin-regexp": "^2.
|
|
101
|
+
"eslint-plugin-regexp": "^2.9.0",
|
|
101
102
|
"eslint-plugin-toml": "^0.12.0",
|
|
102
103
|
"eslint-plugin-unicorn": "^59.0.1",
|
|
103
104
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
104
105
|
"eslint-plugin-vue": "^10.2.0",
|
|
105
106
|
"eslint-plugin-yml": "^1.18.0",
|
|
106
107
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
107
|
-
"globals": "^16.
|
|
108
|
+
"globals": "^16.3.0",
|
|
108
109
|
"jsonc-eslint-parser": "^2.4.0",
|
|
109
110
|
"local-pkg": "^1.1.1",
|
|
110
111
|
"parse-gitignore": "^2.0.0",
|
|
111
112
|
"toml-eslint-parser": "^0.10.0",
|
|
112
|
-
"vue-eslint-parser": "^10.
|
|
113
|
+
"vue-eslint-parser": "^10.2.0",
|
|
113
114
|
"yaml-eslint-parser": "^1.3.0"
|
|
114
115
|
},
|
|
115
116
|
"devDependencies": {
|
|
116
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
117
|
+
"@eslint-react/eslint-plugin": "^1.52.2",
|
|
117
118
|
"@eslint/config-inspector": "^1.1.0",
|
|
118
119
|
"@types/node": "^22.13.10",
|
|
119
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
120
|
-
"@unocss/eslint-plugin": "^66.
|
|
120
|
+
"@typescript-eslint/rule-tester": "^8.35.1",
|
|
121
|
+
"@unocss/eslint-plugin": "^66.3.2",
|
|
121
122
|
"astro-eslint-parser": "^1.2.2",
|
|
122
|
-
"eslint": "^9.
|
|
123
|
+
"eslint": "^9.30.1",
|
|
123
124
|
"eslint-plugin-astro": "^1.3.1",
|
|
124
125
|
"eslint-plugin-format": "^1.0.1",
|
|
125
126
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
126
127
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
127
128
|
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
128
|
-
"eslint-typegen": "^2.2.
|
|
129
|
+
"eslint-typegen": "^2.2.1",
|
|
129
130
|
"jiti": "^2.4.2",
|
|
130
131
|
"prettier-plugin-astro": "^0.14.1",
|
|
131
132
|
"tailwindcss": "3.4.17",
|
|
132
|
-
"tsdown": "^0.12.
|
|
133
|
-
"tsx": "^4.
|
|
133
|
+
"tsdown": "^0.12.9",
|
|
134
|
+
"tsx": "^4.20.3",
|
|
134
135
|
"typescript": "^5.8.3",
|
|
135
|
-
"unocss": "^66.
|
|
136
|
-
"vitest": "^3.2.
|
|
137
|
-
"vue": "^3.5.
|
|
136
|
+
"unocss": "^66.3.2",
|
|
137
|
+
"vitest": "^3.2.4",
|
|
138
|
+
"vue": "^3.5.17"
|
|
138
139
|
},
|
|
139
140
|
"scripts": {
|
|
140
141
|
"build": "pnpm typegen && tsdown --clean --dts",
|