-
Notifications
You must be signed in to change notification settings - Fork 7
/
.eslintrc.js
29 lines (29 loc) · 1.11 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
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // 使用eslint-config-prettier的@ typescript-eslint/eslint-plugin禁用与prettier的冲突的ESLint规则。
'plugin:prettier/recommended', // 启用eslint-plugin-prettier和eslint-config-prettier。确保这是扩展中的最后一个。
'plugin:react/recommended'
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true // 允许解析JSX
}
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off'
},
settings: {
react: {
version: 'detect' // 自动检测要使用的React版本
}
}
}