eslint-config-mgz 1.0.11 → 1.0.100
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/flat-config.js +25 -6
- package/package.json +1 -1
package/flat-config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// eslint-config-mgz/flat-config.js
|
|
2
2
|
/**
|
|
3
|
-
* Universal ESLint config for TypeScript + React
|
|
4
|
-
*
|
|
3
|
+
* Universal ESLint config for projects using TypeScript + React
|
|
4
|
+
* Works with ESLint v7, v8 (FlatCompat) and ESLint v9+ (native flat config)
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
function isEslintV9Plus() {
|
|
@@ -55,6 +55,7 @@ if (isEslintV9Plus()) {
|
|
|
55
55
|
"jsx-a11y": jsxA11y,
|
|
56
56
|
},
|
|
57
57
|
rules: {
|
|
58
|
+
// General rules
|
|
58
59
|
"no-alert": "error",
|
|
59
60
|
"no-console": "error",
|
|
60
61
|
"no-undef-init": "error",
|
|
@@ -62,16 +63,33 @@ if (isEslintV9Plus()) {
|
|
|
62
63
|
"no-var": "error",
|
|
63
64
|
"no-inline-comments": "off",
|
|
64
65
|
"no-use-before-define": "off",
|
|
65
|
-
"
|
|
66
|
-
|
|
66
|
+
"no-duplicate-imports": "warn",
|
|
67
|
+
|
|
68
|
+
// TypeScript
|
|
69
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
70
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
71
|
+
"@typescript-eslint/prefer-const": "error",
|
|
72
|
+
|
|
73
|
+
// React
|
|
67
74
|
"react/react-in-jsx-scope": "off",
|
|
68
75
|
"react/display-name": "off",
|
|
76
|
+
"react/prop-types": "off",
|
|
69
77
|
"react/no-array-index-key": "warn",
|
|
70
|
-
|
|
78
|
+
|
|
79
|
+
// React Hooks
|
|
80
|
+
"react-hooks/rules-of-hooks": "error",
|
|
81
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
82
|
+
|
|
83
|
+
// Import plugin
|
|
84
|
+
"import/no-unresolved": "off",
|
|
85
|
+
"import/named": "off",
|
|
86
|
+
|
|
87
|
+
// JSX A11y
|
|
71
88
|
"jsx-a11y/no-autofocus": "off",
|
|
72
89
|
"jsx-a11y/anchor-has-content": "off",
|
|
73
90
|
"jsx-a11y/heading-has-content": "off",
|
|
74
|
-
|
|
91
|
+
|
|
92
|
+
// Custom unknown props
|
|
75
93
|
"react/no-unknown-property": [
|
|
76
94
|
"error",
|
|
77
95
|
{ ignore: ["cmdk-input-wrapper", "cmdk-empty"] },
|
|
@@ -80,6 +98,7 @@ if (isEslintV9Plus()) {
|
|
|
80
98
|
},
|
|
81
99
|
];
|
|
82
100
|
} else {
|
|
101
|
+
// ESLint v7-8 - legacy config with FlatCompat
|
|
83
102
|
const { FlatCompat } = require("@eslint/eslintrc");
|
|
84
103
|
const baseConfig = require("./base");
|
|
85
104
|
|