-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
55 lines (55 loc) · 1.79 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
module.exports = {
env: {
browser: true,
es2021: true
},
ignorePatterns: ['.eslintrc.js', 'vite.config.ts', 'dist'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'standard-with-typescript',
// 接入 prettier 的规则
'prettier',
'plugin:prettier/recommended'
],
settings: {
react: {
version: 'detect'
}
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true
},
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: ['react', '@typescript-eslint', 'prettier'],
rules: {
'prettier/prettier': 'off',
quotes: ['error', 'single'],
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-extraneous-class': 'off'
}
}