-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
152 lines (151 loc) · 4.04 KB
/
Copy path.eslintrc.js
File metadata and controls
152 lines (151 loc) · 4.04 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
const IS_PROD = process.env.NODE_ENV === 'production'
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:react-hooks/recommended',
'plugin:storybook/recommended',
],
env: {
es6: true,
node: true,
browser: true,
},
rules: {
'react/jsx-curly-brace-presence': [
1,
{
props: 'never',
children: 'never',
},
],
'import/no-named-as-default-member': 0,
'import/no-unresolved': [
1,
{
commonjs: true,
amd: true,
},
],
'import/first': 2,
'import/newline-after-import': 1,
'import/order': [
1,
{
'newlines-between': 'always',
},
],
'import/no-duplicates': 2,
'import/no-useless-path-segments': [
'error',
{
noUselessIndex: true,
},
],
'import/extensions': 0,
semi: ['warn', 'never'],
quotes: [
1,
'single',
{
allowTemplateLiterals: true,
},
],
strict: [2, 'never'],
curly: [2, 'all'],
'no-console': 1,
'no-debugger': IS_PROD ? 'error' : 'warn',
'no-confusing-arrow': 'error',
'arrow-spacing': 'error',
'no-unused-vars': 'off',
'no-delete-var': 'error',
'no-whitespace-before-property': 'error',
'react/display-name': 'off',
'arrow-parens': [1, 'as-needed'],
'jsx-a11y/heading-has-content': 0,
'prettier/prettier': 1,
// TODO: turn on later
'react/prop-types': 'off',
},
settings: {
react: {
version: 'detect',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
project: ['packages/*/tsconfig.json', 'apps/*/tsconfig.json'],
},
},
},
overrides: [
{
files: ['*.mdx'],
extends: 'plugin:mdx/recommended',
},
{
files: ['*.ts', '*.tsx'],
// Your TypeScript files extension
// As mentioned in the comments, you should extend TypeScript plugins here,
// instead of extending them outside the `overrides`.
// If you don't want to extend any rules, you don't need an `extends` attribute.
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
rules: {
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/unbound-method': 0,
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
'@typescript-eslint/no-floating-promises': [
'error',
{
ignoreVoid: true,
},
],
'@typescript-eslint/no-unused-vars': 1,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/restrict-template-expressions': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/restrict-plus-operands': 0,
'@typescript-eslint/no-unsafe-argument': 0,
'@typescript-eslint/no-unsafe-return': 0,
'@typescript-eslint/no-unsafe-call': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'none',
requireLast: false,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
},
parserOptions: {
project: ['./tsconfig.json'], // Specify it only for TypeScript files
},
},
],
}