-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.cjs
126 lines (126 loc) · 4.2 KB
/
.eslintrc.cjs
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
module.exports = {
extends: [
'airbnb-base',
'airbnb-typescript/base', // https://www.npmjs.com/package/eslint-config-airbnb-typescript
'plugin:vue/vue3-recommended',
'@vue/typescript/recommended',
'eslint:recommended', // https://eslint.org/docs/rules/
'plugin:jsx-a11y/strict', // https://www.npmjs.com/package/eslint-plugin-jsx-a11y
],
env: {
browser: true,
es6: true,
node: true,
},
plugins: [
'@typescript-eslint',
'jsx-a11y',
],
parserOptions: {
project: './tsconfig.json',
extraFileExtensions: ['.vue'],
ecmaFeatures: {
jsx: true,
tsx: true,
},
ecmaVersion: 2020,
useJSXTextNode: true,
sourceType: 'module',
},
rules: {
// eslint
'import/export': 'off',
'import/prefer-default-export': 'off',
'no-unused-vars': 'off',
'no-undef': 'off',
'prefer-rest-params': 'off',
'no-async-promise-executor': 'off',
'prefer-promise-reject-errors': 'off',
'import/extensions': 'off',
'no-nested-ternary': 'off',
'no-spaced-func': 'off',
'import/no-unresolved': 'off',
// jsx
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/no-noninteractive-tabindex': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
// 代码风格
'vue/multi-word-component-names': 'off',
'arrow-parens': 'off',
'no-else-return': 'off',
'jsx-quotes': ['error', 'prefer-double'],
'import/no-cycle': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-named-as-default-member': 'off',
'operator-linebreak': 'off',
'import/order': 'off',
'linebreak-style': 'off',
'no-console': 'off',
'class-methods-use-this': 'off',
'max-classes-per-file': 'off',
'consistent-return': 'off',
'default-case': 'off',
'global-require': 'off',
'import/no-dynamic-require': 'off',
'generator-star-spacing': 'off',
'max-len': ['error', { 'code': 130 }],
// javascript
'func-names': 'off',
'no-bitwise': 'off',
'no-plusplus': 'off',
'prefer-template': 'off',
'object-curly-newline': 'off',
'no-param-reassign': 'off',
'no-restricted-globals': 'off',
'no-underscore-dangle': 'off',
'no-restricted-syntax': 'off',
'no-useless-escape': 'off',
'no-confusing-arrow': 'off',
'no-new': 'off',
'no-void': 'off',
'prefer-rest-params': 'off',
'no-async-promise-executor': 'off',
'no-case-declarations': 'off',
// typescript
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-useless-constructor': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/await-thenable': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/prefer-regexp-exec': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-unsafe-call:': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
// vue - https://eslint.vuejs.org/rules/
'vue/no-setup-props-destructure': 'off',
'vue/require-default-prop': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/max-attributes-per-line': ['warn', {
singleline: {
max: 3,
},
multiline: {
max: 1,
}
}]
},
}