-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
57 lines (57 loc) · 1.81 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
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
plugins: ['react', '@typescript-eslint', 'react-hooks'],
env: {
browser: true,
node: true,
},
extends: [
'airbnb-typescript',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
],
parserOptions: {
useJSXTextNode: false,
project: './tsconfig.json',
tsconfigRootDir: './',
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
rules: {
'@typescript-eslint/explicit-function-return-type': ['error', {
allowTypedFunctionExpressions: true,
allowExpressions: true,
}],
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/no-dupe-class-members': 'off',
'@typescript-eslint/comma-spacing': 'off',
'@typescript-eslint/member-delimiter-style': ['error', {
multiline: {
delimiter: 'none',
requireLast: false,
},
singleline: {
delimiter: 'comma',
requireLast: false,
},
}],
'max-len': ['error', { code: 120 }],
'implicit-arrow-linebreak': 0,
'object-curly-newline': ['error', { minProperties: 4, consistent: true }],
'react-hooks/rules-of-hooks': 'error',
'react/jsx-max-props-per-line': [2, { maximum: 3, when: 'always' }],
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'import/no-unresolved': 0,
'import/extensions': 0,
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
}