This repository has been archived by the owner on Dec 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
117 lines (114 loc) · 4.25 KB
/
.eslintrc.js
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
module.exports = {
extends: [
'standard',
'semistandard',
'plugin:vue/base',
'plugin:vue/vue3-recommended',
'plugin:vuejs-accessibility/recommended',
'plugin:jest/recommended',
],
env: {
browser: true,
node: true,
amd: true,
},
globals: {
__VUEPRESS_SSR__: 'readonly',
},
rules: {
camelcase: ['error', {
properties: 'never', // Ignore snake_case in JSON properties, which are often params.
allow: ['^opt_'], // Allow opt_varname arguments.
}],
'comma-dangle': ['error', 'always-multiline'],
'max-len': ['error', {
code: 120,
tabWidth: 2,
}],
'prefer-promise-reject-errors': ['error', {
allowEmptyReject: true,
}],
'vue/comma-dangle': ['error', 'always-multiline'],
'vue/component-name-in-template-casing': ['error', 'kebab-case', {
registeredComponentsOnly: true,
}],
'vuejs-accessibility/label-has-for': [
'error',
{
required: {
some: ['nesting', 'id'],
},
allowChildren: true,
},
],
'vue/new-line-between-multi-line-property': ['warn'],
'vue/html-comment-content-spacing': ['warn'],
'vue/no-potential-component-option-typo': ['warn'],
'vue/multi-word-component-names': ['off'],
'vue/no-reserved-component-names': ['error', {
disallowVueBuiltInComponents: true,
disallowVue3BuiltInComponents: true,
}],
'vue/no-v-model-argument': ['warn'],
'vue/padding-line-between-blocks': ['warn'],
'vue/require-direct-export': ['warn'],
'vue/require-name-property': ['error'],
'vue/valid-next-tick': ['error'],
'vue/block-tag-newline': ['error'],
'vue/no-duplicate-attr-inheritance': ['error'],
'vue/no-undef-components': ['error', {
ignorePatterns: ['icon-', 'router-link', 'toc', 'dtc-', 'dt-'],
}],
'vue/v-on-event-hyphenation': ['error'],
'vue/no-template-target-blank': ['error'],
'vue/no-static-inline-styles': ['off'],
'vuejs-accessibility/iframe-has-title': 'warn',
'vuejs-accessibility/aria-props': 'warn',
'max-lines': ['warn', { max: 300, skipBlankLines: true, skipComments: true }],
quotes: ['error', 'single', { allowTemplateLiterals: true }],
complexity: ['warn', 5],
// Vue core extensions
// these all match regular non-vue ESLint rules,
// but makes them apply to js within the vue template.
'vue/array-bracket-spacing': ['error', 'never'],
'vue/arrow-spacing': ['error', { before: true, after: true }],
'vue/block-spacing': ['error', 'always'],
'vue/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'vue/camelcase': ['error', {
properties: 'never', // Ignore snake_case in JSON properties, which are often params.
allow: ['^opt_'], // Allow opt_varname arguments.
}],
'vue/comma-spacing': ['error', { before: false, after: true }],
'vue/comma-style': ['error', 'last'],
'vue/dot-location': ['error', 'property'],
'vue/dot-notation': ['error', { allowKeywords: true }],
'vue/eqeqeq': ['error', 'always', { null: 'ignore' }],
'vue/func-call-spacing': ['error', 'never'],
'vue/key-spacing': ['error', { beforeColon: false, afterColon: true }],
'vue/keyword-spacing': ['error', { before: true, after: true }],
'vue/no-constant-condition': ['error', { checkLoops: false }],
'vue/no-empty-pattern': 'error',
'vue/no-extra-parens': ['error', 'functions'],
'vue/no-irregular-whitespace': 'error',
'vue/no-sparse-arrays': 'error',
'vue/object-curly-newline': ['error', { multiline: true, consistent: true }],
'vue/object-curly-spacing': ['error', 'always'],
'vue/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }],
'vue/operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before', '|>': 'before' } }],
'vue/prefer-template': ['error'],
'vue/space-in-parens': ['error', 'never'],
'vue/space-infix-ops': 'error',
'vue/space-unary-ops': ['error', { words: true, nonwords: false }],
'vue/template-curly-spacing': ['error', 'never'],
'vue/no-v-html': 'off',
'jest/expect-expect': 'off',
'vue/max-attributes-per-line': ['warn', {
singleline: {
max: 8,
},
multiline: {
max: 1,
},
}],
},
};