Why this matters
`SELECT ... FROM a, b WHERE ...` is an implicit cross join whose join condition is buried in `WHERE`. Forget the condition and you silently get a cartesian product. Explicit `JOIN ... ON ...` puts the join condition next to the join.
Examples
Incorrect
SELECT a.id FROM a, b WHERE a.id = b.id;Correct
SELECT a.id FROM a JOIN b ON a.id = b.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/no-implicit-join": "warn",
},
},
]; Options
Edit the SQL — only no-implicit-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
no-implicit-join — plus no-syntax-error as a safety net.