Skip to content

Commit bb18a7d

Browse files
authored
fix(eslint): update React rules and remove hook (#315)
## Summary Updates React ESLint rules configuration to align with eslint-plugin-react-x recommendations and removes unused post-merge hook. ## Changes - **ESLint Config**: Updated React rules in `packages/eslint-config/src/configs/react.ts` - Fixed comment to reference correct plugin name (eslint-plugin-react-x) - Re-enabled JSX rules: `jsx-no-duplicate-props`, `jsx-uses-react`, `jsx-uses-vars` - Added `jsx-no-comment-textnodes` rule - Consolidated `no-comment-textnodes` into `jsx-no-comment-textnodes` - Removed `no-misused-capture-owner-stack` rule - Cleaned up commented-out rule - **Husky Hook**: Removed `.husky/post-merge` hook (no longer needed) - **Changeset**: Added changeset for patch version bump ## Motivation Ensures React ESLint rules are properly configured according to the latest eslint-plugin-react-x recommendations and removes unused automation that is no longer required. ## Summary by CodeRabbit * **Updates** * Updated React ESLint rules configuration to use improved rule set from eslint-plugin-react-x * **Chores** * Removed post-merge hook for conditional dependency installation * Updated internal documentation for commit message creation
1 parent 3e1b672 commit bb18a7d

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

.changeset/fix-react-rules.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@mheob/eslint-config': patch
3+
---
4+
5+
Update React ESLint rules configuration.

.claude/commands/create-commit.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ description: Create a git commit
1010
- Current branch: !`git branch --show-current`
1111
- Recent commits: !`git log --oneline -10`
1212

13-
## Your task
13+
## Your tasks
1414

15-
Create changeset if needed (at least an empty changeset) and create a single git commit based on the above changes.
15+
- create changeset if needed (at least an empty changeset); write the change message in a full sentence
16+
- create a single git commit based on the above changes
1617

1718
Use conventional commits with a title length of max 50 characters. See @commitlint.config.js for more details.
1819

.husky/post-merge

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/eslint-config/src/configs/react.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ export async function react(
166166
'react-web-api/no-leaked-resize-observer': 'warn',
167167
'react-web-api/no-leaked-timeout': 'warn',
168168

169-
// recommended rules from eslint-plugin-react https://eslint-react.xyz/docs/rules/overview#core-rules
170-
'react/jsx-no-duplicate-props': 'off',
171-
'react/jsx-no-undef': 'off',
172-
'react/jsx-uses-react': 'off',
173-
'react/jsx-uses-vars': 'off',
169+
// recommended rules from eslint-plugin-react-x https://eslint-react.xyz/docs/rules/overview#core-rules
170+
'react/jsx-no-comment-textnodes': 'warn',
171+
'react/jsx-no-duplicate-props': 'warn',
172+
'react/jsx-uses-react': 'warn',
173+
'react/jsx-uses-vars': 'warn',
174174
'react/no-access-state-in-setstate': 'error',
175175
'react/no-array-index-key': 'warn',
176176
'react/no-children-count': 'warn',
@@ -179,7 +179,6 @@ export async function react(
179179
'react/no-children-only': 'warn',
180180
'react/no-children-to-array': 'warn',
181181
'react/no-clone-element': 'warn',
182-
'react/no-comment-textnodes': 'warn',
183182
'react/no-component-will-mount': 'error',
184183
'react/no-component-will-receive-props': 'error',
185184
'react/no-component-will-update': 'error',
@@ -190,9 +189,7 @@ export async function react(
190189
'react/no-duplicate-key': 'warn',
191190
'react/no-forward-ref': 'warn',
192191
'react/no-implicit-key': 'warn',
193-
// 'react/no-leaked-conditional-rendering': 'warn', // deactivated because it is not working (parserOptions issue)
194192
'react/no-missing-key': 'error',
195-
'react/no-misused-capture-owner-stack': 'error',
196193
'react/no-nested-component-definitions': 'error',
197194
'react/no-nested-lazy-component-declarations': 'warn',
198195
'react/no-prop-types': 'error',

0 commit comments

Comments
 (0)