-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
101 lines (99 loc) · 2.74 KB
/
.eslintrc.json
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
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"airbnb",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:effector/recommended",
"plugin:effector/scope",
"plugin:prettier/recommended"
// does this
// {
// "extends": ["prettier"],
// "plugins": ["prettier"],
// "rules": {
// "prettier/prettier": "error",
// "arrow-body-style": "off",
// "prefer-arrow-callback": "off"
// }
// }
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint", "effector"],
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
},
"typescript": {
"alwaysTryTypes": true
}
}
},
"rules": {
// General
"react/react-in-jsx-scope": "off",
"camelcase": "error",
"spaced-comment": "error",
"quotes": ["error", "single"],
"object-curly-newline": "off",
"prefer-template": "off",
"no-restricted-syntax": "off",
"no-duplicate-imports": "error",
"import/no-unresolved": "error",
"no-continue": "warn",
// Warn instead error for fast debugging
"no-console": "warn",
// Breaks custom wrappers for UIKits (<CustomBtn ...props />)
"prefer-destructuring": "warn",
// Works bad with VS Code auto wrapping
"max-len": "off",
// Disable errors in React components
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
// Pass prop types inside React ts components generic with ease
"react/function-component-definition": [
"error",
{
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
],
// use ts instead prop-types
"react/require-default-props": "off",
"react/no-unused-prop-types": "warn",
// I don't like default exports
"import/prefer-default-export": "off",
// Needed in development
"no-unused-vars": "warn",
// Breaks some features on Next.js & MUI
"react/jsx-props-no-spreading": "warn",
// Sometimes works bad with prettier printWidth
"implicit-arrow-linebreak": "off",
// Effector have hooks that memoize data under the hood
"react/no-unstable-nested-components": "warn",
"react/jsx-filename-extension": [2, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }],
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
]
}
}