forked from dominant-strategies/quai-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
107 lines (102 loc) · 2.92 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
module.exports = {
root: true,
env: {
es6: true,
browser: true,
node: true,
jest: true,
},
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSXJavaScript and TypeScript
},
},
extends: [
'airbnb',
'eslint:recommended',
'plugin:import/recommended',
'plugin:react/recommended',
'prettier',
],
plugins: ['react', 'react-hooks', 'prettier'],
rules: {
// JS common rules
'global-require': 0,
'arrow-parens': 0,
'arrow-body-style': ['error', 'as-needed'],
'function-paren-newline': 0,
'object-curly-newline': 0,
'no-prototype-builtins': 0,
'no-restricted-syntax': 0,
'func-names': [
'error',
'always',
{
generators: 'never',
},
],
'implicit-arrow-linebreak': 0,
'operator-linebreak': 0,
'newline-per-chained-call': 0,
'no-confusing-arrow': 0,
'no-console': 1,
'no-use-before-define': 0,
'no-plusplus': 0,
'prefer-template': 2,
'require-yield': 0,
'comma-dangle': ['error', 'always-multiline'],
// Import rules
'import/no-extraneous-dependencies': 0,
'import/no-named-as-default': 0,
'import/no-unresolved': 2,
'import/prefer-default-export': 0,
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
},
],
// React rules
'react/require-default-props': 0,
'react/function-component-definition': [
2,
{
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
},
],
'react/prop-types': 0,
// JSX rules
'react/jsx-filename-extension': 0,
'react/jsx-no-target-blank': 0,
'react/jsx-wrap-multilines': 0,
'react/jsx-props-no-spreading': 0,
'react/jsx-curly-brace-presence': [
2,
{
props: 'never',
children: 'never',
},
],
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
// React hooks rules
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'prettier/prettier': 'error',
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx'],
},
},
},
}