-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
149 lines (149 loc) · 4.33 KB
/
.eslintrc
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
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:storybook/recommended",
"plugin:jest-dom/recommended",
"plugin:testing-library/react",
"standard-with-typescript",
"airbnb",
"airbnb/hooks",
"airbnb-typescript",
"prettier"
],
"parser": "@typescript-eslint/parser",
"root": true,
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"eslint.packageManager": "yarn",
"react": {
"version": "detect"
}
},
"plugins": [
"react",
"@typescript-eslint",
"import",
"formatjs",
"prettier",
"unused-imports",
"simple-import-sort",
"sort-keys-fix",
"sort-destructure-keys",
"jest-dom",
"testing-library"
],
"rules": {
// -----------------------------------------------------
// React -----------------------------------------------
// -----------------------------------------------------
"react/jsx-filename-extension": "off",
"react/require-default-props": "off",
"react/react-in-jsx-scope": "off",
"react/function-component-definition": [
"error",
{
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
],
"react/jsx-props-no-spreading": "off",
"react/jsx-wrap-multilines": "off",
"react/jsx-curly-newline": "off",
"react/jsx-sort-props": "error",
// -----------------------------------------------------
// TypeScript ------------------------------------------
// -----------------------------------------------------
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
// -----------------------------------------------------
// Formatjs --------------------------------------------
// -----------------------------------------------------
"formatjs/no-offset": "error",
"formatjs/enforce-default-message": "error",
"formatjs/enforce-description": "off",
"formatjs/enforce-placeholders": "error",
"formatjs/no-multiple-whitespaces": "error",
"formatjs/enforce-id": [
"error",
{
"idInterpolationPattern": "[sha512:contenthash:base64:6]"
}
],
"formatjs/no-emoji": "error",
"formatjs/no-literal-string-in-jsx": "error",
"formatjs/no-multiple-plurals": "error",
"formatjs/no-complex-selectors": [
"error",
{
"limit": 3
}
],
// -----------------------------------------------------
// Linting ---------------------------------------------
// -----------------------------------------------------
"prettier/prettier": "error",
// -----------------------------------------------------
// General ---------------------------------------------
// -----------------------------------------------------
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/prefer-default-export": "off",
"no-multiple-empty-lines": [
"error",
{
"max": 2,
"maxEOF": 1
}
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/*.stories.tsx",
"**/*.test.*",
"**/test/*",
"*.config.ts",
".storybook/*"
]
}
],
"import/order": "error",
"unused-imports/no-unused-imports": "error",
"sort-keys-fix/sort-keys-fix": "error",
"sort-destructure-keys/sort-destructure-keys": "error"
},
// -----------------------------------------------------
// Overrides -------------------------------------------
// -----------------------------------------------------
"overrides": [
{
"files": ["**/*.stories.ts", "**/*.stories.tsx"],
"rules": {
"no-console": "off",
"formatjs/no-literal-string-in-jsx": "off"
}
},
{
"files": ["**/*.test.ts", "**/*.test.tsx"],
"rules": {
"formatjs/no-literal-string-in-jsx": "off"
}
}
]
}