eslint-config-mgz 1.0.9 → 1.0.11

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.
Files changed (2) hide show
  1. package/flat-config.js +8 -27
  2. 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 projects using TypeScript + React
4
- * Works with ESLint v7, v8 (FlatCompat) and ESLint v9+ (native flat config)
3
+ * Universal ESLint config for TypeScript + React projects
4
+ * Supports ESLint v7, v8 (FlatCompat) and ESLint v9+ (native flat config)
5
5
  */
6
6
 
7
7
  function isEslintV9Plus() {
@@ -17,7 +17,7 @@ let config;
17
17
 
18
18
  if (isEslintV9Plus()) {
19
19
  // ESLint v9+ flat config
20
- const { flat } = require("@eslint/js");
20
+ const js = require("@eslint/js");
21
21
  const tseslint = require("typescript-eslint");
22
22
  const reactPlugin = require("eslint-plugin-react");
23
23
  const reactHooks = require("eslint-plugin-react-hooks");
@@ -35,7 +35,7 @@ if (isEslintV9Plus()) {
35
35
  "eslint.config.*",
36
36
  ],
37
37
  },
38
- flat.configs.recommended,
38
+ js.configs.recommended,
39
39
  ...tseslint.configs.recommended,
40
40
  {
41
41
  files: ["**/*.{ts,tsx,js,jsx}"],
@@ -55,7 +55,6 @@ if (isEslintV9Plus()) {
55
55
  "jsx-a11y": jsxA11y,
56
56
  },
57
57
  rules: {
58
- // General rules
59
58
  "no-alert": "error",
60
59
  "no-console": "error",
61
60
  "no-undef-init": "error",
@@ -63,33 +62,16 @@ if (isEslintV9Plus()) {
63
62
  "no-var": "error",
64
63
  "no-inline-comments": "off",
65
64
  "no-use-before-define": "off",
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
65
+ "import/no-unresolved": "off",
66
+ "import/named": "off",
74
67
  "react/react-in-jsx-scope": "off",
75
68
  "react/display-name": "off",
76
- "react/prop-types": "off",
77
69
  "react/no-array-index-key": "warn",
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
70
+ "no-duplicate-imports": "warn",
88
71
  "jsx-a11y/no-autofocus": "off",
89
72
  "jsx-a11y/anchor-has-content": "off",
90
73
  "jsx-a11y/heading-has-content": "off",
91
-
92
- // Custom unknown props
74
+ "react/prop-types": "off",
93
75
  "react/no-unknown-property": [
94
76
  "error",
95
77
  { ignore: ["cmdk-input-wrapper", "cmdk-empty"] },
@@ -98,7 +80,6 @@ if (isEslintV9Plus()) {
98
80
  },
99
81
  ];
100
82
  } else {
101
- // ESLint v7-8 - legacy config with FlatCompat
102
83
  const { FlatCompat } = require("@eslint/eslintrc");
103
84
  const baseConfig = require("./base");
104
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-mgz",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "main": "flat-config.js",
5
5
  "type": "commonjs",
6
6
  "peerDependencies": {