feat(eslint-plugin-jest): add no-duplicate-hooks rule#1026
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new lint rule jest/no-duplicate-hooks to disallow duplicate Jest lifecycle hooks within the same scope. It includes the rule implementation, documentation, Go unit tests, and TypeScript-based integration tests. However, the reviewer identified a critical issue in rstest.config.mts where the newly added test file was not registered, and an unrelated test file was added instead, which would prevent the integration tests from running.
| './tests/eslint-plugin-jest/rules/no-mocks-import.test.ts', | ||
| './tests/eslint-plugin-jest/rules/no-standalone-expect.test.ts', | ||
| './tests/eslint-plugin-jest/rules/no-test-prefixes.test.ts', | ||
| './tests/eslint-plugin-jest/rules/prefer-called-with.test.ts', |
There was a problem hiding this comment.
In rstest.config.mts, the test file for the newly added no-duplicate-hooks rule (./tests/eslint-plugin-jest/rules/no-duplicate-hooks.test.ts) was not included. Instead, ./tests/eslint-plugin-jest/rules/prefer-called-with.test.ts was added, which seems to be a copy-paste error or an unrelated change. Please update this to include the correct test file so that the tests for no-duplicate-hooks are actually executed.
'./tests/eslint-plugin-jest/rules/no-duplicate-hooks.test.ts',
… into feat/no-duplicate-hooks * 'feat/no-duplicate-hooks' of github.com:eryue0220/rslint: test(eslint-plugin-runner): skip worker-pool e2e suites on windows (napi terminate aborts) (web-infra-dev#1031) feat: port rule react/checked-requires-onchange-or-readonly (web-infra-dev#1030) chore(deps): update actions/checkout action to v6 (web-infra-dev#1007) chore(deps): update actions/setup-go action to v6 (web-infra-dev#1009) chore(deps): update actions/setup-node action to v6 (web-infra-dev#1010) feat: port rule @stylistic/jsx-indent-props (web-infra-dev#1028) feat(eslint-plugin-runner): new package for ESLint plugin compatibility runtime (web-infra-dev#991) feat: port rule @stylistic/jsx-function-call-newline (web-infra-dev#1027) feat(eslint-plugin-jest): add `prefer-called-with` rule (web-infra-dev#1025) feat: port rule @stylistic/jsx-first-prop-new-line (web-infra-dev#1024) feat: port rule @stylistic/jsx-curly-spacing (web-infra-dev#1023)
Summary
no-duplicate-hooksfrom eslint-plugin-jest to rslint.Related Links
Tracking issue: #476
eslint-plugin-jest/no-duplicate-hooks doc code
Checklist