-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
93 lines (92 loc) · 2.82 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
const path = require('path');
module.exports = {
parser: '@typescript-eslint/parser',
env: {
browser: true,
node: true,
jest: true,
es6: true,
'cypress/globals': true,
serviceworker: true,
},
plugins: ['react', 'flowtype', 'import', 'cypress', 'relay', '@typescript-eslint', 'react-hooks'],
parserOptions: {
ecmaVersion: 10,
sourceType: 'module',
ecmaFeatures: {
modules: true,
},
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:import/errors',
'plugin:relay/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
],
rules: {
'comma-dangle': [2, 'always-multiline'],
quotes: [2, 'single', { allowTemplateLiterals: true, avoidEscape: true }],
'jsx-quotes': [2, 'prefer-single'],
'react/prop-types': 0,
'no-case-declarations': 0,
'react/jsx-no-bind': 0,
'react/display-name': 0,
'new-cap': 0,
'no-unexpected-multiline': 0,
'no-class-assign': 1,
'no-console': 2,
'object-curly-spacing': [1, 'always'],
'import/first': 2,
'import/default': 0,
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-extra-boolean-cast': 0,
'import/named': 0,
'import/namespace': [2, { allowComputed: true }],
'import/no-duplicates': 2,
'import/order': [2, { 'newlines-between': 'always-and-inside-groups' }],
'react/no-children-prop': 1,
'react/no-deprecated': 1,
'import/no-cycle': 1,
'import/no-self-import': 1,
'relay/graphql-syntax': 'error',
'relay/compat-uses-vars': 'warn',
'relay/graphql-naming': 'error',
'relay/generated-flow-types': 'warn',
'relay/no-future-added-value': 'warn',
'relay/unused-fields': 0,
indent: 0,
'@typescript-eslint/indent': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'interface-over-type-literal': 0,
'@typescript-eslint/consistent-type-definitions': 0,
'@typescript-eslint/prefer-interface': 0,
'lines-between-class-members': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-unused-vars': [
'error',
{
ignoreRestSiblings: true,
},
],
'@typescript-eslint/no-var-requires': 1,
'react-hooks/rules-of-hooks': 'error',
// disable as it can cause more harm than good
//'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/no-empty-function': 1,
'@typescript-eslint/interface-name-prefix': 0,
},
settings: {
'import/resolver': {
node: true,
'eslint-import-resolver-typescript': true,
'eslint-import-resolver-lerna': {
packages: path.resolve(__dirname, 'packages'),
},
},
},
};