-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.eslintrc.js
126 lines (126 loc) · 3.43 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
module.exports = {
root: true,
ignorePatterns: [
'node_modules/',
'**/node_modules/*',
'.next/',
'out/',
'public/',
'.prettierrc.js',
'.eslintrc.js',
'tailwind.config.js',
'aws-exports.js',
'backend/',
],
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
'jest/globals': true,
jest: true,
},
parserOptions: {ecmaVersion: 8},
extends: ['eslint:recommended'],
overrides: [
// This configuration will apply only to TypeScript files
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.eslint.json',
tsconfigRootDir: './',
},
extends: [
'eslint:recommended',
'airbnb',
'airbnb/hooks',
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:testing-library/react',
'plugin:jest-dom/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:jsx-a11y/recommended',
'plugin:jest/recommended',
'plugin:jest/style',
],
rules: {
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': 'off',
'react/jsx-filename-extension': [0],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'react/jsx-props-no-spreading': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/interactive-supports-focus': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'no-use-before-define': [
'error',
{functions: false, classes: true, variables: true},
],
'no-console': 'off',
'no-unused-vars': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
optionalDependencies: false,
peerDependencies: false,
},
],
'import/prefer-default-export': 'off',
'prettier/prettier': ['error'],
'import/extensions': 'off',
},
plugins: [
'import',
'@typescript-eslint',
'jest',
'prettier',
'react',
'react-hooks',
'testing-library',
'jest-dom',
],
globals: {
window: true,
document: true,
localStorage: true,
FormData: true,
FileReader: true,
Blob: true,
navigator: true,
fetch: false,
browser: true,
jest: true,
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
settings: {
react: {
version: 'detect',
},
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
moduleDirectory: ['node_modules', 'src/'],
},
},
},
},
],
};