-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
77 lines (76 loc) · 2.16 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
'use strict';
module.exports = {
parser: require.resolve('@typescript-eslint/parser'),
extends: [
'plugin:n/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:react/recommended',
'prettier',
],
plugins: ['prettier', 'import', '@typescript-eslint', 'react', 'react-hooks'],
parserOptions: {
ecmaVersion: 2018,
},
env: {
node: true,
es6: true,
},
rules: {
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/prefer-ts-expect-error': 'error',
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', caughtErrors: 'all' },
],
'@typescript-eslint/consistent-type-imports': [
'error',
{ fixStyle: 'inline-type-imports', disallowTypeAnnotations: false },
],
'@typescript-eslint/no-import-type-side-effects': 'error',
'no-else-return': 'error',
'no-negated-condition': 'error',
eqeqeq: ['error', 'smart'],
strict: 'error',
'prefer-template': 'warn',
'object-shorthand': ['warn', 'always', { avoidExplicitReturnArrows: true }],
'prefer-destructuring': [
'error',
{ VariableDeclarator: { array: true, object: true } },
],
'sort-imports': ['error', { ignoreDeclarationSort: true }],
'prettier/prettier': 'error',
// TS covers this
'n/no-missing-import': 'off',
'n/no-unsupported-features/es-syntax': 'off',
'n/no-unsupported-features/es-builtins': 'error',
'import/no-commonjs': 'error',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-unused-modules': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
// handled by TS
'react/prop-types': 'off',
},
settings: {
react: {
version: 'detect',
},
},
overrides: [
{
files: 'src/**/*',
parserOptions: {
sourceType: 'module',
},
},
{
files: ['.eslintrc.js', 'babel.config.js'],
rules: {
'import/no-commonjs': 'off',
},
},
],
};