-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
67 lines (67 loc) · 2.1 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
module.exports = {
root: true,
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:vue/essential',
'airbnb-base',
],
globals: {
dayjs: true,
VueRouter: true,
Vue: true,
ELEMENT: true,
Vuex: true,
axios: true,
lodash: true,
Mock: true,
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'vue',
],
settings: {
'import/resolver': {
webpack: {
// 此处config对应webpack.config.js的路径,我这个路径是vue-cli3默认的路径
config: 'node_modules/@vue/cli-service/webpack.config.js',
},
},
},
rules: {
'comma-dangle': 'off',
'linebreak-style': 'off',
'no-unused-expressions': 'off', // 禁止未使用过的表达式 (no-unused-expressions)
'dot-notation': 'off', // 要求使用点号 (dot-notation) ojb['xxx']
'no-trailing-spaces': 'off', // 禁用行尾空白
'no-restricted-syntax': 'off', // 禁止使用特定的语法
'import/extensions': [2, 'never', { js: 'never', json: 'never' }],
'import/no-extraneous-dependencies': [2, { devDependencies: true }],
'import/no-unresolved': [2, { ignore: ['vuex'] }],
'import/no-cycle': 0,
'prefer-destructuring': 'off', // 优先使用数组和对象解构
'no-continue': 'off',
'no-underscore-dangle': 'off', // 禁止标识符中有悬空下划线
'no-plusplus': 'off',
'no-multi-assign': 'off',
'no-console': 'off',
'max-len': ['error', { code: 120 }],
semi: ['warn', 'never'],
indent: ['warn', 4],
'no-param-reassign': 'off',
// 'vue/script-indent': ['error', 2, { baseIndent: 1 }],
},
overrides: [{ files: ['*.vue'], rules: { indent: 'off' } }],
}
// eslint-disable-line
/* eslint-disable */