-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.eslintrc.js
98 lines (98 loc) · 2.52 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
module.exports = {
env: {
jest: true,
},
extends: ["airbnb-typescript-prettier"],
settings: {
"import/resolver": {
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
},
},
plugins: ["filenames"],
rules: {
"prettier/prettier": [
"error",
{
trailingComma: "es5",
singleQuote: false,
printWidth: 80,
bracketSpacing: true,
tabWidth: 2,
semi: true,
},
],
"react/jsx-filename-extension": [
1,
{
extensions: ["ts", "tsx"],
},
],
"react/react-in-jsx-scope": 0,
"react/jsx-props-no-spreading": 0,
"react/require-default-props": 0,
"import/prefer-default-export": 0,
"no-unused-expressions": "off",
// disabling circular dependency, as it is causing issues
"import/no-cycle": 0,
// allow param reassign for redux-toolkit
"no-param-reassign": ["error", { props: false }],
// no return types needed if it can be inferred. useful for react components and sagas so it's less to worry about
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"react/button-has-type": 0,
"import/no-extraneous-dependencies": [
"error",
{ devDependencies: ["**/*.stories.tsx"] },
],
"no-restricted-imports": [
"error",
{
patterns: ["@app/features/*/*/*"],
},
],
"import/order": [
"error",
{
"newlines-between": "always",
groups: [
["builtin", "external"],
"internal",
["parent", "sibling", "index"],
"unknown",
],
alphabetize: { order: "asc" },
pathGroups: [
{
pattern: "styles/**",
group: "internal",
position: "after",
},
{ group: "builtin", pattern: "react", position: "before" },
],
pathGroupsExcludedImportTypes: ["builtin"],
},
],
},
overrides: [
{
files: ["*.ts"],
rules: {
"filenames/match-regex": [2, "^[a-z-.]+$", true],
},
},
{
files: ["*.tsx"],
rules: {
"filenames/match-regex": [2, "^[A-Z][a-z].+(?:[A-Z][a-z].+)*$", true],
},
},
{
files: ["src/index.tsx", "src/reportWebVitals.ts", "src/setupTests.ts"],
rules: {
"filenames/match-regex": "off",
},
},
],
};