-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
131 lines (111 loc) · 3.6 KB
/
eslint.config.mjs
File metadata and controls
131 lines (111 loc) · 3.6 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// eslint.config.mjs
// @ts-check
import withNuxt from './.nuxt/eslint.config.mjs'
export default withNuxt({
// ============================================================
// 🔹 Ignored Paths
// ============================================================
ignores: [
// Auto-generated / build folders
'.nuxt',
'.output',
'.vercel',
'dist',
'node_modules',
// Lock / config / logs
'package-lock.json',
'pnpm-lock.yaml',
'yarn.lock',
'*.log',
// Static assets
'public/**',
'static/**',
// Local / IDE folders
'.vscode/**',
'.idea/**',
],
// ============================================================
// 🔹 File Patterns
// ============================================================
files: [
'**/*.js',
'**/*.ts',
'**/*.vue',
'**/*.mjs',
'**/*.cjs',
],
// ============================================================
// 🔹 ESLint Rules
// ============================================================
rules: {
// ------------------------------------------------------------
// 🧩 Code Quality
// ------------------------------------------------------------
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-debugger': 'error',
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'eqeqeq': 'error',
'curly': 'error',
// ------------------------------------------------------------
// 🎨 Style & Readability
// ------------------------------------------------------------
// Indentation handled by Vue (avoid conflicts)
'indent': 'off',
// Template indentation
'vue/html-indent': ['warn', 2, {
attribute: 1,
baseIndent: 1,
closeBracket: 0,
alignAttributesVertically: true,
}],
// Script indentation (<script> / <script setup>)
'vue/script-indent': ['warn', 2, {
baseIndent: 0,
switchCase: 1,
ignores: [],
}],
// Arrow functions: no parentheses when single param
'arrow-parens': 'off',
// Object / array indentation consistency
'object-curly-spacing': ['warn', 'always'],
'object-curly-newline': ['warn', { multiline: true, consistent: true }],
'object-property-newline': ['warn', { allowAllPropertiesOnSameLine: true }],
'array-bracket-spacing': ['warn', 'never'],
// Other spacing & punctuation
'semi': ['warn', 'never'],
'quotes': ['warn', 'single', { allowTemplateLiterals: true }],
'comma-dangle': ['warn', 'always-multiline'],
'space-before-blocks': ['warn', 'always'],
'keyword-spacing': ['warn', { before: true, after: true }],
'space-infix-ops': 'warn',
'eol-last': ['error', 'always'],
// ------------------------------------------------------------
// 🧱 Vue Specific Formatting
// ------------------------------------------------------------
'vue/multi-word-component-names': 'off',
'vue/no-v-html': 'off',
'vue/first-attribute-linebreak': ['warn', {
singleline: 'ignore',
multiline: 'below',
}],
'vue/max-attributes-per-line': ['warn', {
singleline: 3,
multiline: 1,
}],
'vue/attributes-order': ['warn', { alphabetical: true }],
'vue/html-self-closing': ['warn', {
html: { void: 'always', normal: 'never', component: 'always' },
svg: 'always',
math: 'always',
}],
'vue/block-tag-newline': ['warn', {
singleline: 'always',
multiline: 'always',
maxEmptyLines: 0,
}],
'vue/multiline-html-element-content-newline': ['warn', {
ignoreWhenEmpty: true,
allowEmptyLines: false,
}],
},
})