diff --git a/.changeset/fix-react-rules.md b/.changeset/fix-react-rules.md new file mode 100644 index 00000000..5a5167da --- /dev/null +++ b/.changeset/fix-react-rules.md @@ -0,0 +1,5 @@ +--- +'@mheob/eslint-config': patch +--- + +Update React ESLint rules configuration. diff --git a/.claude/commands/create-commit.md b/.claude/commands/create-commit.md index 594f852e..4d71d8be 100644 --- a/.claude/commands/create-commit.md +++ b/.claude/commands/create-commit.md @@ -10,9 +10,10 @@ description: Create a git commit - Current branch: !`git branch --show-current` - Recent commits: !`git log --oneline -10` -## Your task +## Your tasks -Create changeset if needed (at least an empty changeset) and create a single git commit based on the above changes. +- create changeset if needed (at least an empty changeset); write the change message in a full sentence +- create a single git commit based on the above changes Use conventional commits with a title length of max 50 characters. See @commitlint.config.js for more details. diff --git a/.husky/post-merge b/.husky/post-merge deleted file mode 100755 index 140ec181..00000000 --- a/.husky/post-merge +++ /dev/null @@ -1,7 +0,0 @@ -[ -n "$CI" ] && exit 0 - -changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" - -hasChanged() { echo "$changedFiles" | grep -q "$1"; } - -hasChanged pnpm-lock.yaml && pnpm install diff --git a/packages/eslint-config/src/configs/react.ts b/packages/eslint-config/src/configs/react.ts index 37f1564d..32fc3b82 100644 --- a/packages/eslint-config/src/configs/react.ts +++ b/packages/eslint-config/src/configs/react.ts @@ -166,11 +166,11 @@ export async function react( 'react-web-api/no-leaked-resize-observer': 'warn', 'react-web-api/no-leaked-timeout': 'warn', - // recommended rules from eslint-plugin-react https://eslint-react.xyz/docs/rules/overview#core-rules - 'react/jsx-no-duplicate-props': 'off', - 'react/jsx-no-undef': 'off', - 'react/jsx-uses-react': 'off', - 'react/jsx-uses-vars': 'off', + // recommended rules from eslint-plugin-react-x https://eslint-react.xyz/docs/rules/overview#core-rules + 'react/jsx-no-comment-textnodes': 'warn', + 'react/jsx-no-duplicate-props': 'warn', + 'react/jsx-uses-react': 'warn', + 'react/jsx-uses-vars': 'warn', 'react/no-access-state-in-setstate': 'error', 'react/no-array-index-key': 'warn', 'react/no-children-count': 'warn', @@ -179,7 +179,6 @@ export async function react( 'react/no-children-only': 'warn', 'react/no-children-to-array': 'warn', 'react/no-clone-element': 'warn', - 'react/no-comment-textnodes': 'warn', 'react/no-component-will-mount': 'error', 'react/no-component-will-receive-props': 'error', 'react/no-component-will-update': 'error', @@ -190,9 +189,7 @@ export async function react( 'react/no-duplicate-key': 'warn', 'react/no-forward-ref': 'warn', 'react/no-implicit-key': 'warn', - // 'react/no-leaked-conditional-rendering': 'warn', // deactivated because it is not working (parserOptions issue) 'react/no-missing-key': 'error', - 'react/no-misused-capture-owner-stack': 'error', 'react/no-nested-component-definitions': 'error', 'react/no-nested-lazy-component-declarations': 'warn', 'react/no-prop-types': 'error',