Skip to content

ci: make Prettier the only formatter and check formatting in CI - #220

Merged
sadjow merged 3 commits into
mainfrom
ci/prettier-format-check
Oct 14, 2026
Merged

sadjow merged 3 commits into
mainfrom
ci/prettier-format-check

Conversation

@sadjow

@sadjow sadjow commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Formatting had two owners. .prettierrc and pnpm format describe Prettier, while ESLint's stylistic rules, tuned to approximate Prettier, enforced a different layout in CI. They disagreed on Vue templates, quoted object keys, and long lines, so running pnpm format produced code that pnpm lint rejected, and six files had drifted from Prettier.

Prettier now owns formatting and ESLint checks everything else:

  • eslint.config.mjs turns off Nuxt's stylistic feature, drops the overrides that imitated Prettier, and appends eslint-config-prettier to switch off the remaining formatting rules (vue/html-self-closing, vue/html-end-tags, unicorn/number-literal-case). The nuxt.config key order rule, which came with stylistic, is enabled explicitly so it keeps applying. no-unexpected-multiline stays enabled even though eslint-config-prettier turns it off: this codebase omits semicolons, and the rule catches a new line that silently continues the previous statement, which Prettier would otherwise join into one plausible line. The eslint-config-prettier CLI reports no conflicting rules for Vue, TypeScript, and JavaScript files.
  • CI runs pnpm format:check after linting, so the required build checks now cover formatting.
  • The six files Prettier flagged are formatted. pnpm-lock.yaml is in .prettierignore because pnpm writes it in its own format.
  • The legacy .eslintrc and .eslintrc.prettier.js, which ESLint 10 no longer reads, are removed along with .eslintprettier.config.js. The lint:prettier script that used it failed with eslintConfig is not iterable, so eslint-plugin-prettier is removed too.
  • README.md and docs/CONTRIBUTING.md list pnpm format:check with the local checks.

Comparing the enabled rules before and after, the only removals are formatting rules: 62 @stylistic rules, the Vue template layout rules, import/newline-after-import, jsdoc/check-alignment, jsdoc/multiline-blocks, and unicorn/number-literal-case. Without the stylistic preset, Nuxt's Vue config also enables vue/one-component-per-file and vue/require-default-prop, which pass.

Validation: actionlint with shellcheck, pnpm format:check, pnpm lint --max-warnings 0, pnpm test:types, pnpm dev:build, pnpm test (81 tests), pnpm test:package, the workspace playground build, and pnpm test:compatibility pass.

@sadjow

sadjow commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

Review notes before merging:

  • Comparing the effective ESLint rules on main and here for .ts, .vue, .mjs, .mts, and nuxt.config.ts files, every removal is a layout rule except one: eslint-config-prettier also turns off no-unexpected-multiline. Without semicolons, a line starting with ( silently continues the previous statement, and pnpm format then joins both into one plausible line. The type checker catches that in .ts files, but not in the .mjs scripts or the ESLint config. 6782d53 enables the rule again after the Prettier config, and a probe with that pattern now fails lint while the eslint-config-prettier CLI still reports no conflicts.
  • The nuxt.config key order rule still flags misordered keys, format:check fails the required build jobs on an unformatted file, and the changed files in the other open PRs pass the new config.

@sadjow
sadjow enabled auto-merge (squash) October 14, 2026 01:15
@sadjow
sadjow merged commit 7ac4b1f into main Oct 14, 2026
7 checks passed
@sadjow
sadjow deleted the ci/prettier-format-check branch October 14, 2026 01:19
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.

1 participant