-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
39 lines (38 loc) · 1.15 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
// The env is development during local development, so it overrides all the rules to "warn"
// The env will be undefined for GH actions or when yarn lint-staged gets fired during pre-commit hooks,
// so we can still catch any violations there
const env = process.env.NODE_ENV;
module.exports = {
env: {
browser: true,
es6: true,
},
extends: ['react-app', 'react-app/jest', 'eslint:recommended'],
rules: {
'react/react-in-jsx-scope': 'off',
'import/no-unused-modules': 'off',
'@typescript-eslint/no-unused-vars':
env === 'development' ? 'warn' : 'error',
'no-unused-vars': env === 'development' ? 'warn' : 'error',
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'@typescript-eslint/no-unused-vars': [
env === 'development' ? 'warn' : 'error',
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true },
],
},
},
{
files: ['**/*.js', '**/*.jsx'],
rules: {
'no-unused-vars': [
env === 'development' ? 'warn' : 'error',
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true },
],
},
},
],
};