All rules
Style
postgresql/
Enforce a consistent stance on the explicit `INNER` keyword in `INNER JOIN`.
Why this matters
Bare `JOIN` means `INNER JOIN` in PostgreSQL, but it is the same word that introduces every other join type, so a misread is easy. The `always` style requires the explicit `INNER`; the `never` style removes it. `LEFT JOIN`, `RIGHT JOIN`, `FULL JOIN`, `CROSS JOIN`, and `NATURAL JOIN` are out of scope.
Examples
Incorrect
SELECT u.id FROM users u JOIN orders o ON o.user_id = u.id;Correct
SELECT u.id FROM users u INNER JOIN orders o ON o.user_id = u.id;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/consistent-explicit-inner-join": [
"warn",
{
style: "always",
},
],
},
},
]; Options
Edit the SQL — only consistent-explicit-inner-join 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
consistent-explicit-inner-join — plus no-syntax-error as a safety net.