Skip to content

fix(react-template): remove demo tests and format generated files after remove:demo - #1851

Merged
pplancq merged 1 commit into
mainfrom
fix/remove-demo-orphaned-tests-and-formatting
Aug 6, 2026
Merged

fix(react-template): remove demo tests and format generated files after remove:demo#1851
pplancq merged 1 commit into
mainfrom
fix/remove-demo-orphaned-tests-and-formatting

Conversation

@pplancq

@pplancq pplancq commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Closes #1850

Bug description

After running npm run remove:demo in a freshly initialized @pplancq/react-template project, the validation pipeline failed because:

  1. Orphaned demo tests in tests/unit/demo/ still imported removed @Demo/... modules.
  2. Generated source files used single quotes and arrow-function styles that conflicted with the project's Prettier/ESLint rules.
  3. package.json and tsconfig.json were rewritten without a trailing newline, causing Prettier to complain.
  4. The demo e2e test in tests/e2e/demo.test.ts was left behind, failing against the new home page.

Changes

  • Remove tests/unit/demo/ and tests/e2e/demo.test.ts during remove:demo.
  • Add a minimal tests/e2e/home.test.ts so the e2e suite still has tests to run.
  • Rewrite all generated .ts/.tsx files with double quotes and Prettier-compatible formatting.
  • Use () => { ... } for the empty ContainerModule callback to avoid the @typescript-eslint/no-unused-vars error.
  • Use implicit return in the generated Home component to satisfy arrow-body-style.
  • Add trailing newlines to rewritten package.json and tsconfig.json, then run Prettier on them to ensure they match the project's formatting rules.

Verification

Tested by copying the template to a temporary directory, running node scripts/removeDemo.cjs, and executing the full validation command from the issue:

npm run lint && npm run test -- --coverage && npm run build

All steps now pass.

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@pplancq pplancq self-assigned this Aug 6, 2026
@pplancq
pplancq merged commit 8d6d1ec into main Aug 6, 2026
11 checks passed
@pplancq
pplancq deleted the fix/remove-demo-orphaned-tests-and-formatting branch August 6, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(react-template): remove:demo script leaves invalid demo tests and prettier/eslint violations

1 participant