eslint-config-mgz 1.0.12 → 1.0.1002

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 +31 -14
  2. package/package.json +1 -1
package/flat-config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // eslint-config-mgz/flat-config.js
2
2
  /**
3
- * Universal ESLint config for TypeScript + React projects
3
+ * Universal ESLint config for projects using TypeScript + React
4
4
  * Works with ESLint v7, v8 (FlatCompat) and ESLint v9+ (native flat config)
5
5
  */
6
6
 
@@ -39,6 +39,14 @@ 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
+ },
42
50
  plugins: {
43
51
  "@typescript-eslint": tseslint.plugin,
44
52
  react: reactPlugin,
@@ -46,16 +54,8 @@ if (isEslintV9Plus()) {
46
54
  import: importPlugin,
47
55
  "jsx-a11y": jsxA11y,
48
56
  },
49
- settings: {
50
- react: { version: "detect" },
51
- "import/resolver": {
52
- node: {
53
- paths: ["src"],
54
- extensions: [".js", ".jsx", ".ts", ".tsx"],
55
- },
56
- },
57
- },
58
57
  rules: {
58
+ // General rules
59
59
  "no-alert": "error",
60
60
  "no-console": "error",
61
61
  "no-undef-init": "error",
@@ -63,20 +63,37 @@ if (isEslintV9Plus()) {
63
63
  "no-var": "error",
64
64
  "no-inline-comments": "off",
65
65
  "no-use-before-define": "off",
66
- "import/no-unresolved": "off",
66
+ "no-duplicate-imports": "warn",
67
+
68
+ // TypeScript
69
+ "@typescript-eslint/no-unused-vars": "warn",
70
+ "@typescript-eslint/no-explicit-any": "warn",
71
+ "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
- "no-duplicate-imports": "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
71
88
  "jsx-a11y/no-autofocus": "off",
72
89
  "jsx-a11y/anchor-has-content": "off",
73
90
  "jsx-a11y/heading-has-content": "off",
74
- "react/prop-types": "off",
91
+
92
+ // Custom unknown props
75
93
  "react/no-unknown-property": [
76
94
  "error",
77
95
  { ignore: ["cmdk-input-wrapper", "cmdk-empty"] },
78
96
  ],
79
- "import/named": "off",
80
97
  },
81
98
  },
82
99
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-mgz",
3
- "version": "1.0.12",
3
+ "version": "1.0.1002",
4
4
  "main": "flat-config.js",
5
5
  "type": "commonjs",
6
6
  "peerDependencies": {