-
Notifications
You must be signed in to change notification settings - Fork 137
/
.eslintrc.js
118 lines (118 loc) · 3.44 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
108
109
110
111
112
113
114
115
116
117
118
module.exports = {
root: true,
globals: {
JSX: true,
React: true,
ChildNode: true,
ReactElement: true,
globalThis: true,
Locale: true,
SendBird: true,
},
env: {
browser: true,
es6: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts'],
},
},
},
rules: {
'no-unused-expressions': 'off',
'no-await-in-loop': 'off',
// Not to make ESLint complains a type is only being used as type but recognized as a unused variable
// https://stackoverflow.com/questions/57802057/eslint-configuring-no-unused-vars-for-typescript
'no-unused-vars': 'off', // or '@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-expressions': 'error',
'react/display-name': 'off',
'react/function-component-definition': 'off',
'react/prop-types': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
// TODO(Ahyoung): fix and remove one by one
'no-shadow': 'off',
'no-else-return': 'off',
'no-param-reassign': 'off',
'no-useless-escape': 'off',
'no-underscore-dangle': 'off',
'no-confusing-arrow': 'off',
'no-mixed-operators': 'off',
'no-nested-ternary': 'off',
'no-unneeded-ternary': 'off',
'no-use-before-define': 'off',
'no-cond-assign': 'off',
'no-plusplus': 'off',
'no-bitwise': 'off',
'no-restricted-syntax': 'off',
'no-prototype-builtins': 'off',
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-useless-path-segments': 'off',
'import/prefer-default-export': 'off',
'import/order': 'off',
'import/no-named-as-default-member': 'off',
'object-curly-newline': 'off',
'object-shorthand': 'off',
'consistent-return': 'off',
'max-len': 'off',
'arrow-body-style': 'off',
'function-paren-newline': 'off',
'prefer-template': 'off',
'padded-blocks': 'off',
'arrow-parens': 'off',
'dot-notation': 'off',
camelcase: 'off',
radix: 'off',
'prefer-destructuring': 'off',
'default-case': 'off',
curly: 'off',
yoda: 'off',
'brace-style': 'off',
'nonblock-statement-body-position': 'off',
'func-names': 'off',
// In some cases, eslint requires semicolon and wants it removed at the same time
// https://stackoverflow.com/questions/58474874/eslint-demands-semicolon-and-wants-it-removed-at-the-same-time
semi: 'off',
'@typescript-eslint/semi': ['error'],
'object-curly-spacing': ['error', 'always'],
quotes: ['error', 'single'],
},
extends: ['plugin:react/recommended', 'plugin:@typescript-eslint/recommended', 'airbnb-base'],
plugins: ['react', '@typescript-eslint', 'unused-imports'],
ignorePatterns: ['node_modules', 'ui/QuoteMessageInput/mockMessage.ts'],
};