-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
50 lines (50 loc) · 1.09 KB
/
Copy path.eslintrc.js
File metadata and controls
50 lines (50 loc) · 1.09 KB
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
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'plugin:vue/vue3-essential',
'airbnb-base',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
],
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser',
sourceType: 'module',
},
plugins: ['vue', '@typescript-eslint'],
rules: {
// 使用airbnb规范时会提示eslint应在依赖中而不是开发依赖中,下面以禁用警告
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
// 组件命名
'vue/multi-word-component-names': [
'error',
{
ignores: ['index'], // 需要忽略的组件名
},
],
// 文件后缀
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
settings: {
// 识别别名
'import/resolver': {
typescript: {
directory: './tsconfig.json',
},
},
},
};