eslint-config-mgz 1.0.11 → 1.0.12
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 +12 -10
- 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
3
|
* Universal ESLint config for TypeScript + React projects
|
|
4
|
-
*
|
|
4
|
+
* Works with ESLint v7, v8 (FlatCompat) and ESLint v9+ (native flat config)
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
function isEslintV9Plus() {
|
|
@@ -39,14 +39,6 @@ if (isEslintV9Plus()) {
|
|
|
39
39
|
...tseslint.configs.recommended,
|
|
40
40
|
{
|
|
41
41
|
files: ["**/*.{ts,tsx,js,jsx}"],
|
|
42
|
-
languageOptions: {
|
|
43
|
-
parser: tseslint.parser,
|
|
44
|
-
parserOptions: {
|
|
45
|
-
project: "./tsconfig.json",
|
|
46
|
-
ecmaVersion: "latest",
|
|
47
|
-
sourceType: "module",
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
42
|
plugins: {
|
|
51
43
|
"@typescript-eslint": tseslint.plugin,
|
|
52
44
|
react: reactPlugin,
|
|
@@ -54,6 +46,15 @@ if (isEslintV9Plus()) {
|
|
|
54
46
|
import: importPlugin,
|
|
55
47
|
"jsx-a11y": jsxA11y,
|
|
56
48
|
},
|
|
49
|
+
settings: {
|
|
50
|
+
react: { version: "detect" },
|
|
51
|
+
"import/resolver": {
|
|
52
|
+
node: {
|
|
53
|
+
paths: ["src"],
|
|
54
|
+
extensions: [".js", ".jsx", ".ts", ".tsx"],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
57
58
|
rules: {
|
|
58
59
|
"no-alert": "error",
|
|
59
60
|
"no-console": "error",
|
|
@@ -63,7 +64,6 @@ if (isEslintV9Plus()) {
|
|
|
63
64
|
"no-inline-comments": "off",
|
|
64
65
|
"no-use-before-define": "off",
|
|
65
66
|
"import/no-unresolved": "off",
|
|
66
|
-
"import/named": "off",
|
|
67
67
|
"react/react-in-jsx-scope": "off",
|
|
68
68
|
"react/display-name": "off",
|
|
69
69
|
"react/no-array-index-key": "warn",
|
|
@@ -76,10 +76,12 @@ if (isEslintV9Plus()) {
|
|
|
76
76
|
"error",
|
|
77
77
|
{ ignore: ["cmdk-input-wrapper", "cmdk-empty"] },
|
|
78
78
|
],
|
|
79
|
+
"import/named": "off",
|
|
79
80
|
},
|
|
80
81
|
},
|
|
81
82
|
];
|
|
82
83
|
} else {
|
|
84
|
+
// ESLint v7-8 - legacy config with FlatCompat
|
|
83
85
|
const { FlatCompat } = require("@eslint/eslintrc");
|
|
84
86
|
const baseConfig = require("./base");
|
|
85
87
|
|