Skip to content

npm run format is unconfigured and would rewrite 62 of 64 files against the repo's own style #231

Description

@mmcky

The format script (prettier --write "**/*.{ts,tsx,md}") runs with no Prettier configuration in the repo — there is no .prettierrc* file and no prettier key in package.json — so it applies Prettier's defaults, which contradict the style actually in the tree. Anyone who runs the documented npm run format today mass-rewrites the codebase against its own conventions.

Observation Value
Prettier config present none — pure defaults
Files npm run format would rewrite 62 of 64 matched
Quote style in app/ single quotes dominate, 184 imports vs 30
Quote style in tests/ single quotes dominate, 18 imports vs 6
Prettier's default quote style double
Longest line in app/components/ 123 characters
Prettier's default printWidth 80
Format or lint gate in CI none

A second consequence is that prettier --check reports files as unformatted even when nobody has touched them. That came up while working through Copilot's feedback on #221: app/components/SiteFooter.tsx reported as needing formatting at the committed tip, before any local edit, purely because the defaults disagree with the file. That is noise that makes the check useless as a signal, and it invites someone to "fix" it with a --write that churns the whole repo.

Note also that .eslintrc.js exists (extending @remix-run/eslint-config) but there is no lint script and eslint does not run in CI either, so neither formatting nor linting is enforced anywhere today.

Suggested direction

Encode the style that is already in the tree, so the tooling agrees with the code rather than fighting it:

{
  "singleQuote": true,
  "printWidth": 100
}

Worth confirming printWidth against the tree before settling on it — 100 matches most of app/, though a few lines reach 123.

Then two follow-on decisions, each better made separately from adding the config:

  1. Whether to land a one-off normalization commit so the tree is actually clean under the new config. It touches many files, so it wants to be its own commit with no behaviour change, ideally when few branches are in flight.
  2. Whether to add a format:check (and possibly lint) step to CI once the tree is clean, so this cannot drift again.

The alternative to all of the above is to delete the format script, which removes the trap but loses the tooling. Configuring it seems better than dropping it.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceHousekeeping: refactors, tooling, infra, style, env upkeep

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions