@jmlweb/eslint-config-react 1.0.0 → 2.0.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # @jmlweb/eslint-config-react
2
+
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2208f74: Standardize repository field format to object format across all packages and configure syncpack to preserve it.
8
+ - Updated dependencies [2208f74]
9
+ - @jmlweb/eslint-config-base@2.0.1
10
+
11
+ ## 2.0.0
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [fb7ebe3]
16
+ - @jmlweb/eslint-config-base@2.0.0
package/README.md CHANGED
@@ -208,6 +208,13 @@ Add linting scripts to your `package.json`:
208
208
  }
209
209
  ```
210
210
 
211
+ Then run:
212
+
213
+ ```bash
214
+ npm run lint # Lint all files
215
+ npm run lint:fix # Fix auto-fixable issues
216
+ ```
217
+
211
218
  ## 📋 Requirements
212
219
 
213
220
  - **Node.js** >= 20.11.0 (required for `import.meta.dirname` in config files)
@@ -229,6 +236,12 @@ This package requires the following peer dependencies:
229
236
  - `eslint-plugin-simple-import-sort` (^12.0.0)
230
237
  - `@jmlweb/eslint-config-base` (^1.0.0)
231
238
 
239
+ ## 📚 Examples
240
+
241
+ See real-world usage examples:
242
+
243
+ - [`example-react-typescript-app`](../../apps/example-react-typescript-app) - React TypeScript app example
244
+
232
245
  ## 🔗 Related Packages
233
246
 
234
247
  - [`@jmlweb/eslint-config-base`](../eslint-config-base) - Base TypeScript ESLint config (extended by this package)
package/dist/index.cjs CHANGED
@@ -44,8 +44,8 @@ var config = [
44
44
  import_eslint_plugin_react.default.configs.flat.recommended,
45
45
  // React JSX runtime config (for React 17+)
46
46
  import_eslint_plugin_react.default.configs.flat["jsx-runtime"],
47
- // React Hooks recommended config
48
- import_eslint_plugin_react_hooks.default.configs.recommended,
47
+ // Note: We don't spread reactHooks.configs.recommended directly as it uses
48
+ // legacy plugin format (array). Instead, we configure the plugin manually below.
49
49
  {
50
50
  files: ["**/*.tsx", "**/*.jsx"],
51
51
  plugins: {
@@ -72,6 +72,19 @@ var config = [
72
72
  ...import_eslint_config_prettier.default.rules,
73
73
  "simple-import-sort/imports": "error",
74
74
  "simple-import-sort/exports": "error",
75
+ // Override naming convention to allow PascalCase for React components
76
+ "@typescript-eslint/naming-convention": [
77
+ "error",
78
+ { selector: "typeLike", format: ["PascalCase"] },
79
+ { selector: "variable", format: ["camelCase", "UPPER_CASE"] },
80
+ {
81
+ selector: "variable",
82
+ modifiers: ["const", "exported"],
83
+ format: ["camelCase", "UPPER_CASE", "PascalCase"]
84
+ },
85
+ // Allow PascalCase for functions (React components)
86
+ { selector: "function", format: ["camelCase", "PascalCase"] }
87
+ ],
75
88
  // React plugin overrides
76
89
  "react/react-in-jsx-scope": "off",
77
90
  // Not needed with new JSX transform
package/dist/index.js CHANGED
@@ -10,8 +10,8 @@ var config = [
10
10
  react.configs.flat.recommended,
11
11
  // React JSX runtime config (for React 17+)
12
12
  react.configs.flat["jsx-runtime"],
13
- // React Hooks recommended config
14
- reactHooks.configs.recommended,
13
+ // Note: We don't spread reactHooks.configs.recommended directly as it uses
14
+ // legacy plugin format (array). Instead, we configure the plugin manually below.
15
15
  {
16
16
  files: ["**/*.tsx", "**/*.jsx"],
17
17
  plugins: {
@@ -38,6 +38,19 @@ var config = [
38
38
  ...prettierConfig.rules,
39
39
  "simple-import-sort/imports": "error",
40
40
  "simple-import-sort/exports": "error",
41
+ // Override naming convention to allow PascalCase for React components
42
+ "@typescript-eslint/naming-convention": [
43
+ "error",
44
+ { selector: "typeLike", format: ["PascalCase"] },
45
+ { selector: "variable", format: ["camelCase", "UPPER_CASE"] },
46
+ {
47
+ selector: "variable",
48
+ modifiers: ["const", "exported"],
49
+ format: ["camelCase", "UPPER_CASE", "PascalCase"]
50
+ },
51
+ // Allow PascalCase for functions (React components)
52
+ { selector: "function", format: ["camelCase", "PascalCase"] }
53
+ ],
41
54
  // React plugin overrides
42
55
  "react/react-in-jsx-scope": "off",
43
56
  // Not needed with new JSX transform
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmlweb/eslint-config-react",
3
- "version": "1.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "ESLint configuration for React libraries with TypeScript, extending base config with React-specific rules",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -8,33 +8,29 @@
8
8
  "types": "./dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "require": {
12
- "types": "./dist/index.d.cts",
13
- "default": "./dist/index.cjs"
14
- },
15
11
  "import": {
16
12
  "types": "./dist/index.d.ts",
17
13
  "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
18
  }
19
19
  }
20
20
  },
21
21
  "files": [
22
22
  "dist",
23
- "README.md"
23
+ "README.md",
24
+ "CHANGELOG.md"
24
25
  ],
25
- "scripts": {
26
- "build": "tsup",
27
- "clean": "rm -rf dist",
28
- "prepublishOnly": "pnpm build"
29
- },
30
26
  "keywords": [
27
+ "code-quality",
31
28
  "eslint",
32
29
  "eslint-config",
33
- "react",
34
- "typescript",
35
30
  "linting",
36
- "code-quality",
37
- "react-hooks"
31
+ "react",
32
+ "react-hooks",
33
+ "typescript"
38
34
  ],
39
35
  "author": "jmlweb",
40
36
  "license": "MIT",
@@ -42,9 +38,7 @@
42
38
  "type": "git",
43
39
  "url": "https://github.com/jmlweb/tooling.git"
44
40
  },
45
- "bugs": {
46
- "url": "https://github.com/jmlweb/tooling/issues"
47
- },
41
+ "bugs": "https://github.com/jmlweb/tooling/issues",
48
42
  "homepage": "https://github.com/jmlweb/tooling/tree/main/packages/eslint-config-react#readme",
49
43
  "engines": {
50
44
  "node": ">=20.11.0"
@@ -54,7 +48,7 @@
54
48
  },
55
49
  "peerDependencies": {
56
50
  "@eslint/js": "^9.0.0",
57
- "@jmlweb/eslint-config-base": "^1.0.0",
51
+ "@jmlweb/eslint-config-base": "^2.0.1",
58
52
  "eslint": "^9.0.0",
59
53
  "eslint-config-prettier": "^9.1.0",
60
54
  "eslint-plugin-react": "^7.37.0",
@@ -63,12 +57,10 @@
63
57
  "typescript-eslint": "^8.0.0"
64
58
  },
65
59
  "dependencies": {
66
- "@jmlweb/eslint-config-base": "workspace:*"
60
+ "@jmlweb/eslint-config-base": "2.0.1"
67
61
  },
68
62
  "devDependencies": {
69
63
  "@eslint/js": "^9.39.2",
70
- "@jmlweb/eslint-config-base": "workspace:*",
71
- "@jmlweb/tsconfig-internal": "workspace:*",
72
64
  "@types/eslint": "^9.6.1",
73
65
  "eslint": "^9.39.2",
74
66
  "eslint-config-prettier": "^10.1.8",
@@ -77,6 +69,12 @@
77
69
  "eslint-plugin-simple-import-sort": "^12.1.1",
78
70
  "tsup": "^8.5.1",
79
71
  "typescript": "^5.9.3",
80
- "typescript-eslint": "^8.34.1"
72
+ "typescript-eslint": "^8.34.1",
73
+ "@jmlweb/eslint-config-base": "2.0.1",
74
+ "@jmlweb/tsconfig-internal": "0.0.1"
75
+ },
76
+ "scripts": {
77
+ "build": "tsup",
78
+ "clean": "rm -rf dist"
81
79
  }
82
- }
80
+ }