-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
62 lines (60 loc) · 2.65 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
import withNuxt from './.nuxt/eslint.config.mjs'
export default withNuxt({
files: ['**/*.ts', '**/*.tsx', '**/*.vue', '**/*.js'],
rules: {
// General code style rules
// These rules enforce consistent coding styles and formatting
'semi': ['error', 'always'], // Require semicolons at the end of statements
'quotes': ['error', 'single'], // Use single quotes for strings
'indent': ['error', 2], // Use 2 spaces for indentation
'comma-dangle': ['error', 'always-multiline'], // Require trailing commas in multiline object/array literals
'object-curly-spacing': ['error', 'always'], // Require spaces inside curly braces
'array-bracket-spacing': ['error', 'never'], // Disallow spaces inside array brackets
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always',
}], // Consistent spacing before function parentheses
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }], // Limit consecutive empty lines
'eol-last': ['error', 'always'], // Require newline at the end of files
// Enforces a specific order of component tags: <script>, then <template>, then <style>
'vue/component-tags-order': ['error', {
order: ['script', 'template', 'style'],
}],
// Enforces consistent indentation in <template> (2 spaces)
'vue/html-indent': ['error', 2],
// Disables the rule that bans certain types in TypeScript
'@typescript-eslint/ban-types': 'off',
// Controls line breaks before tag's closing brackets
'vue/html-closing-bracket-newline': ['error', {
singleline: 'never',
multiline: 'always',
}],
// Requires consistent spacing before tag's closing brackets
'vue/html-closing-bracket-spacing': 'error',
// Disables the rule that warns against using v-html
'vue/no-v-html': 'off',
// Disables the rule that disallows explicit 'any' types
'@typescript-eslint/no-explicit-any': 'off',
// Enforces self-closing on HTML elements
'vue/html-self-closing': ['error', {
html: {
void: 'always',
normal: 'always',
component: 'always',
},
}],
// Limits the maximum number of attributes allowed per line
'vue/max-attributes-per-line': ['error', {
singleline: 3,
multiline: 1,
}],
// Disables the rule requiring multi-word component names
'vue/multi-word-component-names': 'off',
// Disables the rule requiring default values for props
'vue/require-default-prop': 'off',
// Disables the rule disallowing empty object types in TypeScript
'@typescript-eslint/no-empty-object-type': 'off',
},
ignores: ['.nuxt', 'node_modules'],
})