Why this matters
Each tuple position is padded so that values share a consistent width across rows. Single-row `VALUES` lists are skipped — the rule only kicks in when there are multiple rows to align.
Examples
Incorrect
INSERT INTO t (a, b, c) VALUES
('GPT-5', 1.25, CURRENT_TIMESTAMP),
('Claude', 5, CURRENT_TIMESTAMP),
('Haiku', 1, CURRENT_TIMESTAMP);Correct
INSERT INTO t (a, b, c) VALUES
('GPT-5', 1.25, CURRENT_TIMESTAMP),
('Claude', 5, CURRENT_TIMESTAMP);Configure it
// eslint.config.js
import postgresql from "eslint-plugin-postgresql";
export default [
{
files: ["**/*.sql"],
languageOptions: {
parser: postgresql.configs.recommended.languageOptions.parser,
},
plugins: { postgresql },
rules: {
"postgresql/align-values": [
"warn",
{
gap: 1,
},
],
},
},
]; Options
Edit the SQL — only align-values is enabled.
Pre-filled with the first incorrect example. Toggle off in the rule shelf to see how the diagnostic disappears.
Diagnostics
No issues found.
2 rules enabled.
Rule under test
align-values — plus no-syntax-error as a safety net.