-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
58 lines (58 loc) · 2.2 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
module.exports = {
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
tsx: true,
jsx: true
}
},
env: {
node: true,
browser: true
},
plugins: ['@typescript-eslint'],
extends: [
// 'eslint:recommended',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:vue/vue3-recommended',
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'taro/vue3'
],
rules: {
// js
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-alert': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-tabs': 2, // 禁止使用tabs
'no-useless-escape': 0,
'no-var': 2, // 使用let和const代替var
'no-mixed-spaces-and-tabs': 2, // 不允许混用tab和空格
'no-useless-return': 0,
'arrow-parens': 0,
camelcase: 0, // 禁用驼峰命名检测
// ts
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-unused-vars': 1,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/consistent-type-imports': 1,
'@typescript-eslint/no-unsafe-function-type': 1,
// vue
'vue/no-parsing-error': [2, { 'x-invalid-end-tag': false }],
'vue/html-self-closing': 0,
'vue/no-use-v-if-with-v-for': 2,
'vue/html-closing-bracket-newline': 0,
'vue/max-attributes-per-line': 0,
'vue/no-unused-components': 1,
'vue/no-mutating-props': 0,
'vue/multi-word-component-names': 0
}
}