@ciridae/configs 0.1.0 → 0.2.0

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 (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/eslint.js +20 -42
  3. package/package.json +7 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ciridae/configs
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Use an ESLint 10-compatible shared baseline and remove legacy ESLint presets.
8
+
3
9
  ## 0.1.0
4
10
 
5
11
  - Publish shared ESLint, Prettier, and TypeScript configurations with explicit subpath exports.
package/eslint.js CHANGED
@@ -1,14 +1,11 @@
1
1
  import { fixupPluginRules } from "@eslint/compat";
2
+ import eslintReact from "@eslint-react/eslint-plugin";
2
3
  import js from "@eslint/js";
3
- import importPlugin from "eslint-plugin-import";
4
- import react from "eslint-plugin-react";
4
+ import { createNodeResolver, importX } from "eslint-plugin-import-x";
5
5
  import globals from "globals";
6
6
  import reactHooks from "eslint-plugin-react-hooks";
7
- import legacyReactHooks from "eslint-plugin-react-hooks-legacy";
8
7
  import reactRefresh from "eslint-plugin-react-refresh";
9
- import legacyReactRefresh from "eslint-plugin-react-refresh-legacy";
10
8
  import tailwindcss from "eslint-plugin-tailwindcss";
11
- import legacyTailwindcss from "eslint-plugin-tailwindcss-legacy";
12
9
  import tseslint from "typescript-eslint";
13
10
 
14
11
  const typeAssertionBan = [
@@ -36,11 +33,11 @@ export function reactAppConfig({ ignores = ["dist"], rules = {} } = {}) {
36
33
  globals: globals.browser,
37
34
  },
38
35
  plugins: {
39
- "react-hooks": legacyReactHooks,
40
- "react-refresh": legacyReactRefresh,
36
+ "react-hooks": reactHooks,
37
+ "react-refresh": reactRefresh,
41
38
  },
42
39
  rules: {
43
- ...legacyReactHooks.configs.recommended.rules,
40
+ ...reactHooks.configs.recommended.rules,
44
41
  "react-refresh/only-export-components": [
45
42
  "warn",
46
43
  { allowConstantExport: true },
@@ -52,20 +49,8 @@ export function reactAppConfig({ ignores = ["dist"], rules = {} } = {}) {
52
49
  );
53
50
  }
54
51
 
55
- export function legacyStrictReactAppConfig(options = {}) {
56
- return createStrictReactAppConfig(options, {
57
- reactHooks: legacyReactHooks,
58
- reactRefresh: legacyReactRefresh,
59
- tailwindcss: legacyTailwindcss,
60
- });
61
- }
62
-
63
52
  export function strictReactAppConfig(options = {}) {
64
- return createStrictReactAppConfig(options, {
65
- reactHooks,
66
- reactRefresh,
67
- tailwindcss,
68
- });
53
+ return createStrictReactAppConfig(options);
69
54
  }
70
55
 
71
56
  function createStrictReactAppConfig(
@@ -80,14 +65,13 @@ function createStrictReactAppConfig(
80
65
  testFiles = ["**/*.test.{ts,tsx}", "**/test/**/*.{ts,tsx}"],
81
66
  overrides = [],
82
67
  } = {},
83
- policyPlugins,
84
68
  ) {
85
69
  const plugins = {
86
- import: fixupPluginRules(importPlugin),
87
- react: fixupPluginRules(react),
88
- "react-hooks": policyPlugins.reactHooks,
89
- "react-refresh": policyPlugins.reactRefresh,
90
- tailwindcss: fixupPluginRules(policyPlugins.tailwindcss),
70
+ "@eslint-react": eslintReact,
71
+ "import-x": importX,
72
+ "react-hooks": reactHooks,
73
+ "react-refresh": reactRefresh,
74
+ tailwindcss: fixupPluginRules(tailwindcss),
91
75
  };
92
76
 
93
77
  return tseslint.config(
@@ -120,8 +104,8 @@ function createStrictReactAppConfig(
120
104
  "@typescript-eslint/no-unsafe-return": "error",
121
105
  "@typescript-eslint/switch-exhaustiveness-check": "error",
122
106
  complexity: ["error", 12],
123
- "import/no-cycle": "error",
124
- "import/no-self-import": "error",
107
+ "import-x/no-cycle": "error",
108
+ "import-x/no-self-import": "error",
125
109
  "max-depth": ["error", 3],
126
110
  "max-lines": [
127
111
  "error",
@@ -138,9 +122,8 @@ function createStrictReactAppConfig(
138
122
  "max-nested-callbacks": ["error", 3],
139
123
  "max-params": ["error", 4],
140
124
  "no-restricted-syntax": ["error", ...typeAssertionBan],
141
- "react/jsx-max-depth": ["error", { max: 4 }],
142
- "react/jsx-no-constructed-context-values": "error",
143
- "react/no-unstable-nested-components": "error",
125
+ "@eslint-react/no-nested-component-definitions": "error",
126
+ "@eslint-react/no-unstable-context-value": "error",
144
127
  "react-refresh/only-export-components": [
145
128
  "warn",
146
129
  { allowConstantExport: true },
@@ -148,18 +131,13 @@ function createStrictReactAppConfig(
148
131
  ...rules,
149
132
  },
150
133
  settings: {
151
- "import/extensions": [".js", ".jsx", ".ts", ".tsx"],
152
- "import/parsers": {
134
+ "import-x/extensions": [".js", ".jsx", ".ts", ".tsx"],
135
+ "import-x/parsers": {
153
136
  "@typescript-eslint/parser": [".ts", ".tsx"],
154
137
  },
155
- "import/resolver": {
156
- node: {
157
- extensions: [".js", ".jsx", ".ts", ".tsx"],
158
- },
159
- },
160
- react: {
161
- version: "detect",
162
- },
138
+ "import-x/resolver-next": [
139
+ createNodeResolver({ extensions: [".js", ".jsx", ".ts", ".tsx"] }),
140
+ ],
163
141
  ...(tailwindCssFiles
164
142
  ? {
165
143
  tailwindcss: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ciridae/configs",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Shared ESLint, Prettier, and TypeScript configurations for Ciridae projects.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -30,19 +30,16 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@eslint/compat": "^2.1.0",
33
- "@eslint/js": "^9.9.0",
34
- "eslint-plugin-import": "^2.32.0",
35
- "eslint-plugin-react": "^7.37.5",
33
+ "@eslint-react/eslint-plugin": "^5.14.6",
34
+ "@eslint/js": "^10.0.1",
35
+ "eslint-plugin-import-x": "^4.17.1",
36
36
  "eslint-plugin-react-hooks": "^7.1.1",
37
- "eslint-plugin-react-hooks-legacy": "npm:eslint-plugin-react-hooks@^5.1.0-rc.0",
38
37
  "eslint-plugin-react-refresh": "^0.5.3",
39
- "eslint-plugin-react-refresh-legacy": "npm:eslint-plugin-react-refresh@^0.4.9",
40
38
  "eslint-plugin-tailwindcss": "4.0.5",
41
- "eslint-plugin-tailwindcss-legacy": "npm:eslint-plugin-tailwindcss@^4.0.0-alpha.2",
42
- "globals": "^15.9.0",
43
- "typescript-eslint": "^8.0.1"
39
+ "globals": "^17.7.0",
40
+ "typescript-eslint": "^8.63.0"
44
41
  },
45
42
  "peerDependencies": {
46
- "eslint": "^9.9.0 || ^10.0.0"
43
+ "eslint": "^10.7.0"
47
44
  }
48
45
  }