-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
55 lines (55 loc) · 1.59 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
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.eslint.json',
tsconfigRootDir: __dirname,
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
plugins: ['jest', '@typescript-eslint', 'react-hooks'],
env: { 'jest/globals': true },
rules: {
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'object-curly-spacing': ['warn', 'always'],
'react/jsx-props-no-spreading': 'off',
'import/prefer-default-export': 'off',
'react-hooks/exhaustive-deps': 'warn',
'no-underscore-dangle': ['error', { allow: ['__typename', '_env_'] }],
'no-param-reassign': [
'error',
{
props: true,
ignorePropertyModificationsFor: ['state'],
},
],
},
settings: {
react: {
version: 'detect',
},
},
overrides: [
{
files: ['**/*.test.tsx', '**/*.test.ts'],
env: {
jest: true,
},
},
],
ignorePatterns: ['.eslintrc.js'], // https://stackoverflow.com/questions/61956555/why-is-typescript-eslint-parser-including-files-outside-of-those-configured-in
};