-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
37 lines (36 loc) · 886 Bytes
/
.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
const path = require('path');
module.exports = {
env: {
browser: true,
es2020: true,
node: true,
},
extends: ['plugin:react/recommended', 'airbnb', 'airbnb/hooks', 'prettier', 'prettier/react'],
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 11,
sourceType: 'module',
},
plugins: ['react'],
rules: {
'react/button-has-type': 'never',
'react/prop-types': 'never',
'react/sort-comp': 'never',
'import/extensions': 'never',
'react/jsx-filename-extension': [1, { extensions: ['.js'] }],
// 取消 .d.ts 声明文件中使用了 constructor 报错 问题
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
},
overrides: [
{
files: ['**/*.d.ts'],
rules: {
'import/no-duplicates': 0,
},
},
],
};