-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
53 lines (46 loc) · 1.46 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
const realConfig = {
extends: [
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/react',
'prettier/@typescript-eslint',
],
plugins: ['prettier'],
env: {
node: true,
browser: true,
jest: true,
},
parserOptions: {
project: './tsconfig.json',
},
rules: {
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true, allowTypedFunctionExpressions: true }],
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '_' }],
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/naming-convention': 'off',
'arrow-body-style': 'off',
radix: 'off',
'no-underscore-dangle': 'off',
'no-console': ['error', { allow: ['warn', 'error'] }],
'react/no-unescaped-entities': 'off',
'import/prefer-default-export': 'off',
'import/no-default-export': 'error',
'react/prop-types': 'off',
'consistent-return': 'off',
'no-nested-ternary': 'off',
},
}
const nopConfig = {
/*
This config is meant to do nothing.
It exists because there's no good way to disable ESLint in Create React App:
https://github.com/facebook/create-react-app/issues/9929
So the workaround here is to craft a config that does as little as possible,
and then conditionally use it.
*/
ignorePatterns: ['**/*.ts', '**/*.tsx', './*.js', 'config/*.js'],
}
module.exports = process.env.DISABLE_ESLINT ? nopConfig : realConfig