Skip to content

test(eslintconfig): verify formatter correctness + perf - #2385

Closed
shikanime wants to merge 2 commits into
mainfrom
wt/t_8c292de1
Closed

test(eslintconfig): verify formatter correctness + perf#2385
shikanime wants to merge 2 commits into
mainfrom
wt/t_8c292de1

Conversation

@shikanime

Copy link
Copy Markdown
Member

Goal

Verifies the formatter work from parent t_9062bcc1 (formatters map { markdown, json }) with a real test suite, and corrects a misleading inline comment.

Changes

  • New test suite packages/eslintconfig/src/index.spec.ts — 9 tests via ESLint lintText(..., {fix:true}):
    • markdown: *- rewrite, 3+ blank lines → 1, trailing-whitespace trim
    • idempotency (markdown + json stable on re-run)
    • json: spacing normalized + trailing newline; content preserved
    • jsonc: comment preserved AND spacing normalized
    • performance: 200 mixed md/json files formatted in 512 ms (< 1 s budget)
  • packages/eslintconfig/vitest.config.ts — node env, src/**/*.spec.{ts,js}.
  • packages/eslintconfig/package.json — added test/format scripts + vitest (catalog:test) devDep. eslint-plugin-format already in catalog:tools from parent.
  • src/index.js — corrected the misnomer comment: .jsonc is already served by the json formatter (prettier keeps comments); only html remains a real opt-in.

Result

All 9 tests pass. No meaningful dev-pipeline latency (cold ESLint bootstrap ~1.7 s amortized in a real pnpm format run).

Reviewer note (latent upstream risk)

Parent t_9062bcc1 is marked completed but its formatter diff (src/index.js, package.json, pnpm-workspace.yaml, pnpm-lock.yaml) was never committed in wt/t_9062bcc1. This PR contains a faithful byte-for-byte reproduction (verified by running the tests against it). Before merge, confirm the parent's worktree is either abandoned in favor of this branch or its changes are committed — otherwise the formatter ships as drift.

Draft per request; not for merge until review.

shikanime and others added 2 commits July 28, 2026 15:54
Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
Change-Id: I6f501bd1633ceb14edaa9bf2a324ea026a6a6964
…ng comment

Add vitest suite (9 tests) exercising markdown/json formatting, idempotency,
jsonc comment-preservation, and a 200-file perf budget (<1s). Correct the
inline comment: .jsonc is already served by the json formatter (prettier keeps
comments), not a separate opt-in.

Co-Authored-By: Hermes <noreply@nous.sh>
@github-actions github-actions Bot added the built label Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Hey !

The security scan report for the current pull request is available here.

@cloud-pi-native-sonarqube

Copy link
Copy Markdown

@shikanime shikanime closed this Jul 28, 2026
@shikanime
shikanime deleted the wt/t_8c292de1 branch July 29, 2026 09:04
@shikanime
shikanime restored the wt/t_8c292de1 branch July 29, 2026 09:08
@shikanime
shikanime deleted the wt/t_8c292de1 branch July 29, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant