Skip to content

feat: add lint rule to enforce kebab-case route names - #8107

Open
cstns wants to merge 2 commits into
mainfrom
feat/standardize-route-names/8093-lint-rule
Open

feat: add lint rule to enforce kebab-case route names#8107
cstns wants to merge 2 commits into
mainfrom
feat/standardize-route-names/8093-lint-rule

Conversation

@cstns

@cstns cstns commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Closes #8093
Part of #8084

Summary

  • Adds a vitest test that scans all routes.js files under frontend/src/ and validates every name: value matches the kebab-case pattern (/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/)
  • Runs as part of npm run test:unit:frontend, so CI will catch any non-kebab-case route names going forward
  • Uses static file analysis (reads files as text, extracts names via regex) to avoid the complexity of importing Vue components in the test environment

Note

This PR should be merged after all the rename PRs (#8085 through #8092) are merged, since the test will fail until all route names are kebab-case.

Test plan

  • npx vitest run test/unit/frontend/routes/route-naming.spec.js --config config/vitest.config.ts fails on main (expected, names not renamed yet)
  • After all rename PRs are merged, the test passes
  • Adding a PascalCase route name causes the test to fail

Adds a vitest test that scans all routes.js files in the frontend and
validates that every route name matches the kebab-case pattern
(lowercase alphanumeric segments separated by hyphens).

This prevents regressions after the route rename effort is complete.

Part of #8093

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cstns cstns self-assigned this Aug 6, 2026
@cstns
cstns requested a review from n-lark August 6, 2026 12:13
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.17%. Comparing base (1218b5e) to head (a9a3f64).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8107   +/-   ##
=======================================
  Coverage   76.17%   76.17%           
=======================================
  Files         440      440           
  Lines       23604    23604           
  Branches     6285     6285           
=======================================
  Hits        17981    17981           
  Misses       5623     5623           
Flag Coverage Δ
backend 76.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@n-lark n-lark left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a fix for the linter issues - looks good

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.

Add lint rule to enforce kebab-case route names

2 participants