Skip to content

Commit e9af679

Browse files
authored
chore: migrate to Nuxt ESLint (#86)
1 parent 7630bb7 commit e9af679

File tree

6 files changed

+369
-1917
lines changed

6 files changed

+369
-1917
lines changed

eslint.config.js

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,43 @@
1-
import antfu from '@antfu/eslint-config'
1+
// @ts-check
2+
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
23

3-
export default antfu({
4-
rules: {
5-
'no-use-before-define': 'off',
6-
'node/prefer-global/buffer': 'off',
7-
'node/prefer-global/process': 'off',
4+
export default createConfigForNuxt({
5+
features: {
6+
stylistic: true,
7+
tooling: true,
8+
},
9+
dirs: {
10+
src: ['./src', './client', './docs'],
811
},
912
})
13+
.override('nuxt/javascript', {
14+
rules: {
15+
'no-console': ['error', { allow: ['warn', 'error'] }],
16+
},
17+
})
18+
.override('nuxt/typescript/rules', {
19+
rules: {
20+
'@typescript-eslint/ban-ts-comment': [
21+
'error',
22+
{
23+
'ts-expect-error': 'allow-with-description',
24+
'ts-ignore': true,
25+
},
26+
],
27+
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
28+
// TODO: Discuss if we want to enable this
29+
'@typescript-eslint/no-invalid-void-type': 'off',
30+
// TODO: Discuss if we want to enable this
31+
'@typescript-eslint/no-explicit-any': 'off',
32+
},
33+
})
34+
.override('nuxt/vue/rules', {
35+
rules: {
36+
'vue/multi-word-component-names': 'off',
37+
'vue/no-v-html': 'off',
38+
'vue/require-default-prop': 'off',
39+
'vue/no-multiple-template-root': 'off',
40+
// NOTE: Disable this style rules if stylistic is not enabled
41+
'vue/max-attributes-per-line': 'off',
42+
},
43+
})

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@
8989
"valibot": "^0.30.0"
9090
},
9191
"devDependencies": {
92-
"@antfu/eslint-config": "2.19.1",
9392
"@nuxt/devtools-ui-kit": "^1.3.3",
93+
"@nuxt/eslint-config": "^0.3.13",
9494
"@nuxt/module-builder": "^0.7.0",
9595
"@nuxt/test-utils": "3.13.1",
9696
"@types/semver": "^7.5.8",
9797
"@unhead/schema": "^1.9.12",
9898
"acorn-loose": "^8.4.0",
9999
"bumpp": "^9.4.1",
100100
"changelogen": "^0.5.5",
101-
"eslint": "9.3.0",
101+
"eslint": "9.4.0",
102102
"nuxt": "^3.11.2",
103103
"playwright-core": "^1.44.1",
104104
"typescript": "^5.4.5",

0 commit comments

Comments
 (0)