-
Notifications
You must be signed in to change notification settings - Fork 22
/
.eslintrc.js
93 lines (87 loc) · 2.32 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
module.exports = {
root: true,
env: {
node: true,
es6: true,
},
extends: [
'airbnb',
'plugin:mocha/recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2023,
sourceType: 'module',
},
plugins: ['prettier', 'simple-import-sort', 'react', 'mocha', 'react-hooks'],
rules: {
// defaults
'no-console': [
'warn',
{
allow: ['error'],
},
],
'no-unused-vars': 'off',
// Prefer non-default exports
'import/no-default-export': 'error',
'import/prefer-default-export': 'off',
// Auto-sort imports
'sort-imports': 'off',
'import/order': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
// REACT
'react/prop-types': 'off', // disable prop-types
'react/require-default-props': 'off', // disable require default props
'react/react-in-jsx-scope': 'off', // react in jsx scope
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'react/function-component-definition': 'off',
"react/no-array-index-key": "off",
"react/jsx-props-no-spreading": "off",
"no-use-before-define": "off",
"import/no-default-export": "off",
"import/prefer-named-exports": "off",
// TS
'@typescript-eslint/no-explicit-any': 'warn', // disable explicit any
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
], // disable unused vars
// disable form label
'jsx-a11y/label-has-associated-control': 'off',
// leverage prettier
'prettier/prettier': 'error',
},
ignorePatterns: [
'**/node_modules/*',
'dist/*',
'tmp/*',
'.next',
'packages/subgraph/*',
'packages/graphql/src/zeus/*',
'packages/subgraph/subgraph.template.yaml',
],
settings: {
'import/resolver': {
typescript: {
project: ['tsconfig.base.json', 'packages/**/tsconfig.json'],
},
node: {
project: ['tsconfig.base.json', 'packages/**/tsconfig.json'],
},
},
},
};