Skip to content

Reject indent and uppercase config options - #982

Open
mosabua wants to merge 1 commit into
sql-formatter-org:masterfrom
mosabua:reject-removed-v5-options
Open

mosabua wants to merge 1 commit into
sql-formatter-org:masterfrom
mosabua:reject-removed-v5-options

Conversation

@mosabua

@mosabua mosabua commented Sep 28, 2026 •

Copy link
Copy Markdown

Fixes #981.

validateConfig already rejects options removed in version 10, but the version 5
removals were never added to that list, so indent and uppercase were accepted
and ignored. A config carried across the version 5 upgrade kept formatting
successfully while quietly falling back to the defaults.

This adds them to the same list, and turns it into a map so the error can name
the replacement:

indent config is no longer supported. Use tabWidth instead.
uppercase config is no longer supported. Use keywordCase instead.

It also rewords the shared message from "is no more supported" to "is no longer
supported", which reads better in English. That touches the six existing entries
and their assertions too, so say the word if you would rather keep the current
wording and I will drop that part.

I considered rejecting every unrecognized key instead, but that is a larger
behavior change and could break callers that pass extra properties. Extending
the existing list covers the upgrade path that actually breaks.

Tests added alongside the existing removed-option tests in
test/sqlFormatter.test.ts. Full suite passes locally: 27 suites, 5887 tests.

- Add the version 5 removals to the removed-options list, so they no
  longer pass silently
- Name the replacement option in the error message
- Reword "no more supported" as "no longer supported"

Assisted-by: Claude Code Opus 5 <noreply@anthropic.com>
@mosabua
mosabua force-pushed the reject-removed-v5-options branch from 3ac7808 to d02932e Compare September 28, 2026 05:58
@mosabua

mosabua commented Sep 28, 2026

Copy link
Copy Markdown
Author

One more instance of the same phrasing that I deliberately left out of this PR, since it is documentation rather than the error message this change touches:

https://github.com/sql-formatter-org/sql-formatter/blob/master/docs/paramTypes.md#L87

- `:1` numbered placeholders are no more supported

That is the only remaining occurrence in the repository outside node_modules. Happy to send a separate one-line PR for it if you want the wording consistent, or to fold it into this one. Just say which you prefer.

This branch has not been deployed

No deployments
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.

Options removed in v5, indent and uppercase, are silently ignored

1 participant