ESLint plugin for formatting SQL queries in .sql files and tagged template literals (sql`...`) in .js/.ts files. Integrates with sql-formatter-org/sql-formatter for consistent SQL formatting. Version 1.0.5 is stable but has low release cadence. Key differentiator: it formats inline SQL in JavaScript/TypeScript template strings, not just standalone .sql files. Alternatives like prettier-plugin-sql or eslint-plugin-sql only handle file-level formatting.
npm install eslint-plugin-sql-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows ESLint configuration with the sql-formatter plugin, enabling the format rule for PostgreSQL with 2-space indentation. Also shows a sql tagged template literal that the plugin will format.
Use 'plugins': ['sql'] in ESLint config.
Pin sql-formatter to v1.x or check plugin compatibility with sql-formatter v2+.
Use 'sql/format' as the rule key.
Set explicitly to avoid future breaking changes.
Run `npm install eslint-plugin-sql-formatter --save-dev` and ensure plugins array contains 'sql' (not 'sql-formatter').
Add 'plugins': ['sql'] and 'rules': { 'sql/format': [...] }.