This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
.eslintrc.yaml
166 lines (142 loc) · 3.65 KB
/
.eslintrc.yaml
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
---
# ESLint rules
# https://eslint.org/docs/rules/
env:
browser: true
es6: true
node: true
jest/globals: true
extends:
# eslint-config-airbnb
# https://github.com/airbnb/javascript
- airbnb
# TypeScript ESLint plugin recommended rules
# https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/recommended.json
- plugin:@typescript-eslint/recommended
# eslint-plugin-import error rules
# https://github.com/benmosher/eslint-plugin-import/blob/master/config/errors.js
- plugin:import/errors
# eslint-plugin-import warning rules
# https://github.com/benmosher/eslint-plugin-import/blob/master/config/warnings.js
- plugin:import/warnings
# eslint-plugin-import typescript rules
# https://github.com/benmosher/eslint-plugin-import/blob/master/config/typescript.js
- plugin:import/typescript
- plugin:prettier/recommended
- prettier
- prettier/@typescript-eslint
- prettier/react
globals:
__DEV__: true
parser: '@typescript-eslint/parser'
parserOptions:
ecmaFeatures:
jsx: true
project: ./tsconfig.json
sourceType: module
plugins:
- '@typescript-eslint'
- jest
- prettier
- prefer-arrow
- react
- react-hooks
- import
root: true
settings:
import/resolver:
node:
extensions:
- .js
- .jsx
- .ts
- .tsx
react:
version: detect
rules:
# eslint official
no-console: 'off'
no-shadow: 'off'
require-yield: error
## Storybook prefers importing with absolute paths
no-restricted-imports:
- error
- patterns: [../*, ./*]
# @typescript-eslint
'@typescript-eslint/explicit-function-return-type': off
'@typescript-eslint/explicit-member-accessibility': off
'@typescript-eslint/indent': off
'@typescript-eslint/no-unnecessary-type-assertion': error
'@typescript-eslint/no-empty-interface': off
'@typescript-eslint/no-explicit-any': off
'@typescript-eslint/camelcase': off
'@typescript-eslint/no-namespace': error
'@typescript-eslint/no-non-null-assertion': off
'@typescript-eslint/no-unused-vars':
- error
- varsIgnorePattern: '[Rr]eact'
# prefer-arrow
prefer-arrow/prefer-arrow-functions:
- error
- disallowPrototype: true
singleReturnOnly: true
classPropertiesAllowed: false
# react
react/jsx-filename-extension:
- error
- extensions:
- jsx
- tsx
react/jsx-one-expression-per-line: off
react/jsx-uses-react: error
react/jsx-uses-vars: error
react/prop-types: off
react/prefer-stateless-function: off
react/destructuring-assignment: off
# react hooks
react-hooks/rules-of-hooks: error
# import
## Disable because the importing with the webpack alias is treated as an undeclared module
import/extensions:
- off
- always
- js: never
jsx: never
ts: never
tsx: never
import/prefer-default-export: off
import/no-unresolved: off
import/order:
- error
- groups:
- internal
- builtin
- external
- parent
- sibling
- index
newlines-between: ignore
## For Storybook
import/no-extraneous-dependencies:
- error
- devDependencies:
- '**/test/**'
# jsx-a11y
jsx-a11y/label-has-for: off
jsx-a11y/label-has-associated-control: off
# Prettier Options
# https://prettier.io/docs/en/options.html
prettier/prettier:
- error
- printWidth: 130
tabWidth: 2
semi: false
singleQuote: true
jsxSingleQuote: false
trailingComma: es5
bracketSpacing: true
jsxBracketSameLine: false
arrowParens: avoid
proseWrap: preserve
htmlWhitespaceSensitivity: css
endOfLine: auto