All rules

Style

postgresql/consistent-explicit-inner-join

Enforce a consistent stance on the explicit `INNER` keyword in `INNER JOIN`.

  • Type layout
  • Recommended off
  • Fixable yes

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

Incorrect
SELECT u.id FROM users u JOIN orders o ON o.user_id = u.id;

Correct

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

style "always" | "never" default: "always"
`always` (default) requires `INNER JOIN`. `never` requires the bare `JOIN` form.
Try this rule

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.

0 errors 0 warnings parse 0ms · rules 0ms
Diagnostics

No issues found.

2 rules enabled.

Rule under test consistent-explicit-inner-join — plus no-syntax-error as a safety net.
eslint-plugin-postgresql

An ESLint plugin that lints .sql files with real PostgreSQL grammar and a curated set of best-practice rules.

© 2026 eslint-plugin-postgresql contributors Built on libpg-query · PostgreSQL 17