ESLint plugin providing SQL linting rules, including formatting via sql-formatter and unsafe query detection. Version 3.4.1 is current, with active development. It supports Postgres and uses template literal tags (default `` sql `` ) to identify SQL. Requires ESLint >=8.1.0 and Node >=18. Differentiated by its focus on safety (no-unsafe-query) and auto-fix formatting. Ships TypeScript types.
npm install eslint-plugin-sqlVerified import paths — ran on the pinned version, not inferred.
Configures ESLint with sql plugin, enabling format and no-unsafe-query rules.
Upgrade Node to >=18
Upgrade ESLint to >=8.1.0
Remove 'ignoreStartWithNewLine' from rule options
Add { ignoreTagless: false } to rule optionsAdd settings: { sql: { placeholderRule: '\\?' } } to ESLint configSet 'allowLiteral: true' explicitly if you want to allow literal strings
Run 'npm install eslint-plugin-sql --save-dev' and add 'plugins: ["sql"]' to ESLint config.
Use array format: 'sql/format': [2, {}] instead of 'sql/format': {}Ensure 'eslint-plugin-sql' is in node_modules and ESLint dependencies are correct.