Repository navigation
refactor: colocate tests and group rules into prefix folders - #134
Merged
Merged
Conversation
Broaden the CI push path filters to cover all workflows, actions, vale rules, fallow config, packages, and tools so edits to those files trigger CI. Simplify the workflow-security change detection by moving the base and head SHAs into environment variables. Update the workflow tests to assert that every workspace package running a CI task has a source file selected by the CI paths, and trim assertions that no longer match the release workflow.
Add the `@interfere/landmines` oxlint plugin and enable its rules as errors for non-benchmark test files, covering flaky patterns such as fixed sleeps, conditional expects, and shared signals. Extract the repeated non-benchmark test glob filter into a shared `NON_BENCHMARKS` constant.
Explanatory comments are removed across the test suite, with the intent they carried moved into descriptive test names, documentation titles, and clearer variable and helper names. Test cases are also grouped into named case arrays where that makes the coverage easier to scan.
Remove explanatory comments from workflow and tool tests, fold their rationale into longer test names where it aids clarity, and rename helpers and variables to clearer names such as `sourceFile` and `sharedInstanceTester`.
Apply formatter changes across test files, including Array type syntax, property ordering, comment wrapping, and import cleanup.
Shorten repeated `@ts-expect-error` explanations in test files to single lines, inline the casts in `isEffectCall` with a SAFETY note, and collect changed files at module scope instead of in a `beforeAll` hook.
Apply the formatter across the test suite, adding blank lines between statements for readability. No test logic or assertions change.
Rename the root `tests/` directory to `test/` and update every reference to it across configs, workflows, docs, and tooling. Move the property tests from `tests/properties/` into `src/properties/` beside the source they exercise, and colocate the documentation unit tests under `documentation/src/` with browser tests under `documentation/test/`.
Replace generic `fail` and `pass` documentation ids with descriptive unique ids across the affected rule tests, so each documented case can be identified individually. Also move the documented cases in `prefer-singular-enums` inline ahead of the shared case arrays.
Rule modules moved into prefix directories are now recognised when parsing git history, so their first commit is used for newness detection. Paths in a grouping folder that do not start with the folder name are still ignored. - update imports in `src/index.ts`, rule tests, and fuzz tests for the moved rule files
Signed-off-by: howmanysmall <26746527+howmanysmall@users.noreply.github.com>
Signed-off-by: howmanysmall <26746527+howmanysmall@users.noreply.github.com>
Move `@interfere/landmines` from the root package to `lint-configurations` and resolve its specifier with `import.meta.resolve`, matching the other oxlint plugins, so the plugin is loaded from the package that declares it.
Contributor
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
commit: |
Contributor
Bundle size
Raw, uncompressed bytes from the minified |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/directory totest/and colocates each suite beside the code it covers (documentation suites move next to their components and intosrc/data/rule/; fixtures, fuzz, and workflow tests regroup undertest/).directive/,prefer/,require/) sosrc/rules/no longer mixes prefixes at one level.vitest.config.tstest roots,turbo.jsoninputs,tsconfig/project references,mise.tomlcoverage sources, CI path filters, and therule-newnessfix for prefix-folder grouping.landmineslint rules (warn, with a couple of targeted disables) and adds the@interfere/landminescatalog entry.Evidence
tests/trees (tests/properties,documentation/tests/unit,tests/workflows), so rule changes and their tests were in disjoint directories and imports used alias paths.src/rules/general/directive/directive-no-use.test.ts,documentation/src/components/rule-index.test.tsx), imports are relative, and all path references across vitest, turbo, tsconfig, mise, and CI point attest/.documentation/test/browser/rule-counts.fixture.tsadded to keep the browser suite deterministic after the move.CI has not reported on this branch yet —
gh run listfor it is empty.Merge Danger
Door: two-way
Every move is a
git mvplus path updates; reverting restores the old layout. The only mildly sticky part ispnpm-lock.yaml/skills-lock.jsonchurn, which re-resolves cleanly.Blast Radius: repo-wide
Touches every package's test paths and CI workflow triggers (
ci.yamlpush paths,deep-tests.yaml), so a missed path reference would silently skip tests rather than fail loudly — worth a close look at the workflow diffs.