-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
49 lines (48 loc) · 1.26 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
// eslint-disable-next-line import/no-extraneous-dependencies
const path = require('path');
/**
* 为什么使用 js 抛出?
* 因为该项目内置了 Webpack,而对 Webpack Resolver 的配置则直接写在本文件中
*/
module.exports = {
root: true,
extends: ['shiwangme', '@nuxtjs', 'prettier', 'prettier/vue', 'plugin:prettier/recommended', 'plugin:nuxt/recommended'],
plugins: ['prettier'],
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
allowImportExportEverywhere: true
},
globals: {
authcode: true
},
rules: {
'import/prefer-default-export': 0,
'vue/no-parsing-error': [
2,
{
'x-invalid-end-tag': false
}
]
},
settings: {
'import/core-modules': ['vue', 'vuex', 'moment'],
'import/resolver': {
webpack: {
config: {
resolve: {
modules: ['node_modules', path.resolve(__dirname)],
extensions: ['.js', '.vue'],
alias: {
// 主要是配置目录别名,以防 ESLint 报错
'~': path.resolve(__dirname),
'~~': path.resolve(__dirname),
'@': path.resolve(__dirname),
'@@': path.resolve(__dirname)
}
}
}
}
}
}
};