@entreprise-os/eslint-config 2.4.43 → 2.4.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +61 -0
- package/package.json +2 -1
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import js from "@eslint/js";
|
|
2
2
|
import tseslint from "typescript-eslint";
|
|
3
3
|
import prettier from "eslint-config-prettier";
|
|
4
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
4
5
|
|
|
5
6
|
export default [
|
|
6
7
|
{
|
|
@@ -26,12 +27,72 @@ export default [
|
|
|
26
27
|
...tseslint.configs.recommended,
|
|
27
28
|
prettier,
|
|
28
29
|
{
|
|
30
|
+
plugins: {
|
|
31
|
+
"react-hooks": reactHooks,
|
|
32
|
+
},
|
|
29
33
|
rules: {
|
|
30
34
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
35
|
+
|
|
36
|
+
// File/Function Size Limits
|
|
31
37
|
"max-lines": [
|
|
32
38
|
"error",
|
|
33
39
|
{ max: 300, skipBlankLines: true, skipComments: true },
|
|
34
40
|
],
|
|
41
|
+
"max-depth": ["warn", 4], // Max nesting depth
|
|
42
|
+
|
|
43
|
+
// Code Complexity
|
|
44
|
+
"max-nested-callbacks": ["warn", 3],
|
|
45
|
+
|
|
46
|
+
// Code Quality
|
|
47
|
+
"no-debugger": "error",
|
|
48
|
+
"no-alert": "warn",
|
|
49
|
+
"no-var": "error", // Use let/const instead
|
|
50
|
+
"prefer-const": "error", // Use const when variable is never reassigned
|
|
51
|
+
"no-duplicate-imports": "error",
|
|
52
|
+
"no-unused-vars": "off", // Turn off base rule
|
|
53
|
+
"@typescript-eslint/no-unused-vars": [
|
|
54
|
+
"warn",
|
|
55
|
+
{
|
|
56
|
+
argsIgnorePattern: "^_",
|
|
57
|
+
varsIgnorePattern: "^_",
|
|
58
|
+
caughtErrorsIgnorePattern: "^_",
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
|
|
62
|
+
// TypeScript Specific
|
|
63
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
64
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
65
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
66
|
+
|
|
67
|
+
// Naming Conventions
|
|
68
|
+
"@typescript-eslint/naming-convention": [
|
|
69
|
+
"warn",
|
|
70
|
+
{
|
|
71
|
+
selector: "variable",
|
|
72
|
+
format: ["camelCase", "UPPER_CASE", "PascalCase"],
|
|
73
|
+
leadingUnderscore: "allow",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
selector: "function",
|
|
77
|
+
format: ["camelCase", "PascalCase"],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
selector: "typeLike",
|
|
81
|
+
format: ["PascalCase"],
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
|
|
85
|
+
// Best Practices
|
|
86
|
+
eqeqeq: ["error", "always"], // Require === and !==
|
|
87
|
+
"no-else-return": "warn",
|
|
88
|
+
"no-lonely-if": "warn",
|
|
89
|
+
"prefer-template": "warn", // Use template literals instead of string concatenation
|
|
90
|
+
"no-useless-return": "warn",
|
|
91
|
+
|
|
92
|
+
// React Hooks
|
|
93
|
+
...reactHooks.configs.recommended.rules,
|
|
94
|
+
"react-hooks/rules-of-hooks": "off",
|
|
95
|
+
"react-hooks/exhaustive-deps": "error",
|
|
35
96
|
},
|
|
36
97
|
},
|
|
37
98
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entreprise-os/eslint-config",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.45",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
|
10
10
|
"@typescript-eslint/parser": "^7.1.0",
|
|
11
11
|
"eslint-config-prettier": "^9.1.0",
|
|
12
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
12
13
|
"typescript-eslint": "^8.0.0"
|
|
13
14
|
},
|
|
14
15
|
"publishConfig": {
|