Skip to content

Commit 0f0a66d

Browse files
committed
build: upgrade ESLint to v9.x
1 parent 7a65f36 commit 0f0a66d

File tree

4 files changed

+84
-88
lines changed

4 files changed

+84
-88
lines changed

.eslintignore

-3
This file was deleted.

.eslintrc.js

-75
This file was deleted.

eslint.config.mjs

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import eslint from '@eslint/js'
2+
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
3+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
4+
import eslintPluginVue from 'eslint-plugin-vue'
5+
import globals from 'globals'
6+
import typescriptEslint from 'typescript-eslint'
7+
8+
export default typescriptEslint.config(
9+
{ ignores: ['**/*.d.ts', '**/coverage', '**/dist', '**/docs', 'eslint.config.mjs'] },
10+
{
11+
extends: [
12+
eslint.configs.recommended,
13+
...typescriptEslint.configs.recommended,
14+
...eslintPluginVue.configs['flat/recommended'],
15+
eslintPluginUnicorn.configs['flat/recommended'],
16+
],
17+
files: ['packages/**/src/**/*.{js,ts,tsx}'],
18+
languageOptions: {
19+
ecmaVersion: 'latest',
20+
sourceType: 'module',
21+
globals: globals.browser,
22+
parserOptions: {
23+
parser: typescriptEslint.parser,
24+
},
25+
},
26+
rules: {
27+
'no-console': 'off',
28+
'no-debugger': 'off',
29+
'unicorn/filename-case': 'off',
30+
'unicorn/no-array-for-each': 'off',
31+
'unicorn/no-null': 'off',
32+
'unicorn/prefer-dom-node-append': 'off',
33+
'unicorn/prefer-export-from': 'off',
34+
'unicorn/prefer-query-selector': 'off',
35+
'unicorn/prevent-abbreviations': 'off',
36+
'vue/require-default-prop': 'off',
37+
},
38+
},
39+
{
40+
files: ['**/*.mjs'],
41+
languageOptions: {
42+
globals: {
43+
...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])),
44+
...globals.node,
45+
},
46+
47+
ecmaVersion: 5,
48+
sourceType: 'module',
49+
},
50+
},
51+
{
52+
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
53+
languageOptions: {
54+
globals: {
55+
...globals.jest,
56+
},
57+
},
58+
},
59+
{
60+
files: ['packages/docs/build/**'],
61+
languageOptions: {
62+
globals: {
63+
...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])),
64+
...globals.node,
65+
},
66+
67+
ecmaVersion: 5,
68+
sourceType: 'commonjs',
69+
},
70+
rules: {
71+
'no-console': 'off',
72+
strict: 'error',
73+
},
74+
},
75+
eslintPluginPrettierRecommended,
76+
)

package.json

+8-10
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,21 @@
1717
"lib:build": "lerna run --scope \"@coreui/vue\" build --stream",
1818
"lib:test": "lerna run --scope \"@coreui/vue\" test --stream",
1919
"lib:test:update": "lerna run --scope \"@coreui/vue\" test:update --stream",
20-
"lint": "eslint \"packages/**/src/**/*.{js,ts,tsx}\"",
20+
"lint": "eslint",
2121
"test": "npm-run-all charts:test icons:test lib:test",
2222
"test:update": "npm-run-all charts:test:update icons:test:update lib:test:update"
2323
},
2424
"devDependencies": {
25-
"@typescript-eslint/eslint-plugin": "^8.6.0",
26-
"@typescript-eslint/parser": "^8.6.0",
27-
"@vue/eslint-config-prettier": "^9.0.0",
28-
"@vue/eslint-config-typescript": "^13.0.0",
2925
"@vue/vue3-jest": "29.2.6",
30-
"eslint": "8.57.0",
31-
"eslint-plugin-prettier": "^5.2.1",
32-
"eslint-plugin-vue": "^9.28.0",
26+
"eslint": "^9.17.0",
3327
"eslint-config-prettier": "^9.1.0",
34-
"eslint-plugin-unicorn": "^55.0.0",
28+
"eslint-plugin-prettier": "^5.2.1",
29+
"eslint-plugin-unicorn": "^56.0.1",
30+
"eslint-plugin-vue": "^9.32.0",
31+
"globals": "^15.14.0",
3532
"lerna": "^8.1.8",
3633
"npm-run-all": "^4.1.5",
37-
"prettier": "^3.3.3"
34+
"prettier": "^3.3.3",
35+
"typescript-eslint": "^8.19.1"
3836
}
3937
}

0 commit comments

Comments
 (0)