-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.old
142 lines (141 loc) · 3.95 KB
/
.eslintrc.old
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
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021,
"ecmaFeatures": {
"tsx": true // Allows for the parsing of TSX ???
}
},
"plugins": ["@typescript-eslint", "import", "react-hooks", "prefer-arrow", "prettier"],
"env": {
"browser": true,
"es6": true,
"node": true,
"jest": true
},
"extends": [
"airbnb",
"eslint:recommended",
"plugin:import/typescript",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:prettier/recommended",
"prettier"
],
"rules": {
/* AirBnb rules */
"import/extensions": [0, "never"],
"no-shadow": ["warn"],
"react/jsx-filename-extension": [0, { "extensions": [".tsx", ".jsx"] }],
// "import/no-unresolved": 1,
// "import/no-unresolved": [2, { "caseSensitiveStrict": true }],
// "no-restricted-imports": [
// "error",
// {
// "patterns": ["src/*"]
// }
// ],
// "no-restricted-imports": [
// "error",
// {
// "patterns": [".*"]
// }
// ],
/* React Hooks rules */
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "error", // Checks effect dependencies
/* Functions rules */
"consistent-return": 0,
"import/prefer-default-export": 0,
// ["error", { "treatUndefinedAsUnspecified": false }],
// "func-style": ["error", "declaration", { "allowArrowFunctions": true }],
// "func-style": ["error", "expression"],
// "prefer-arrow-callback": ["error", { "allowUnboundThis": false }],
// "prefer-arrow/prefer-arrow-functions": [
// "warn",
// {
// "disallowPrototype": true,
// "singleReturnOnly": false,
// "classPropertiesAllowed": false
// }
// ],
/* Comments rules */
"no-warning-comments": [1, { "terms": ["todo", "fixme", "to do", "fix me"], "location": "start" }],
"no-inline-comments": "error",
/* Console rules */
"no-console": 0, // Means warning
/* Typescript rules */
"prettier/prettier": 0, // Means error
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
// "@typescript-eslint/no-var-requires": "off",
/* Special chars rules */
"react/no-unescaped-entities": 1,
/* Disallow imports from src/server/ in src/pages/ except for src/pages/api */
/* (see the "overrides" section for the exception) */
"import/no-restricted-paths": [
"error",
{
"zones": [
{
"target": "./src/pages",
"from": "./src/server"
}
]
}
]
},
// "linters": {
// "eslint": {
// "args": ["--stdin-filename", "@"]
// }
// },
"settings": {
"react": {
"version": "detect" // React version. "detect" automatically picks the version you have installed.
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"paths": ["./"]
}
}
// "import/resolver": {
// "webpack": {
// "config": "webpack.config.js"
// }
// }
// "import/parsers": [".ts", ".tsx", ".js", ".jsx"]
// "import/parsers": [".ts", ".tsx", ".js", ".jsx"]
},
"overrides": [
{
"files": ["next.config.js"]
// "rules": {
// "@typescript-eslint/no-var-requires": "off"
// }
},
{
// Allow imports from src/server/ in src/pages/api
"files": ["src/pages/api/**/*"],
"rules": {
"import/no-restricted-paths": [
"error",
{
"zones": [
{
"target": "./src/pages/api",
"from": "./src/client/"
}
]
}
]
}
}
]
}