-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
79 lines (78 loc) · 2.28 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
module.exports = {
parserOptions: {
project: './tsconfig.json', // Required to have rules that rely on Types.
tsconfigRootDir: './',
},
extends: [
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint',
'plugin:react/recommended',
'prettier',
'prettier/react',
'prettier/@typescript-eslint',
],
plugins: ['@typescript-eslint', 'react-hooks', 'prettier'],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
jsx: true,
useJSXTextNode: true,
},
env: {
browser: true,
},
settings: {
react: {
version: 'detect',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<roo/>@types` directory even it doesn't contain any source code, like `@types/unist`
},
typescript: {
directory: './tsconfig.json',
},
},
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/member-delimiter-style': [
'error',
{
// Prevents us from using any delimiter for interface properties.
multiline: {
delimiter: 'none',
requireLast: false,
},
singleline: {
delimiter: 'comma',
requireLast: false,
},
},
],
'@typescript-eslint/indent': 'off', // This is the job of StandardJS, they are competing rules so we turn off the Typescript one.
'no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],
'react/jsx-props-no-spreading': 'off',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'no-underscore-dangle': 'off',
'import/no-unresolved': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
'react/display-name': 'off',
'no-plusplus':'off'
},
}