-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
88 lines (87 loc) · 2.38 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import withNuxt from './.nuxt/eslint.config.mjs'
import eslint from '@eslint/js'
import globals from 'globals'
import vue from 'eslint-plugin-vue'
import ts from 'typescript-eslint'
import tailwind from 'eslint-plugin-tailwindcss'
export default withNuxt(
[
eslint.configs.recommended,
...ts.configs.strict,
...ts.configs.stylistic,
...vue.configs['flat/strongly-recommended'],
...tailwind.configs['flat/recommended'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
},
parser: vue.parser,
parserOptions: {
parser: ts.parser,
project: './tsconfig.json',
extraFileExtensions: ['.vue'],
sourceType: 'module',
ecmaVersion: 'latest'
}
},
rules: {
// Global
'@stylistic/linebreak-style': ['error', 'unix'],
// Vue.js
'vue/script-indent': ['error', 2, {
baseIndent: 1,
switchCase: 1
}],
'vue/html-self-closing': ['error', {
html: {
void: 'never',
normal: 'never',
component: 'always'
},
svg: 'never',
math: 'never'
}],
'vue/multi-word-component-names': 'off',
'vue/padding-line-between-blocks': ['error', 'always'],
'vue/block-order': ['error', {
order: ['script', 'template', 'style']
}],
'vue/block-lang': ['error', {
script: { lang: 'ts' }
}],
'vue/component-api-style': ['error', ['script-setup']],
'vue/no-v-text': 'error',
'vue/no-restricted-html-elements': [
'error',
{
element: 'a',
message: 'Use <NuxtLink> that a drop-in replacement for both Vue Router\'s <RouterLink> component and HTML\'s <a> tag'
}
],
'vue/max-attributes-per-line': ['error', {
singleline: { max: 999 },
multiline: { max: 1 }
}]
}
},
{
files: ['**/*.vue'],
rules: {
'@stylistic/indent': 'off'
}
},
{
ignores: ['.nuxt/']
}
]
)
.override('nuxt/stylistic', {
rules: {
'@stylistic/arrow-parens': ['error', 'always'],
'@stylistic/no-mixed-operators': 'off',
'@stylistic/comma-dangle': ['error', 'never'],
'@stylistic/quote-props': ['error', 'as-needed']
}
})