ESLint plugin (v3.2.0, maintained) that enforces the use of the `sql` template tag on raw SQL queries to prevent SQL injection. Provides the `no-unsafe-query` rule which disallows interpolated template literals in SQL strings unless tagged with `sql`. Requires ESLint >=9 and Node >=20. Distinct from eslint-plugin-sql or eslint-plugin-safe-sql by focusing specifically on template tag usage rather than SQL syntax validation.
npm install eslint-plugin-sql-templateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up ESLint flat config to disallow unsafe SQL template literals using the sql-template plugin.
Use import syntax and ensure Node >=20. If using CommonJS, stay on v2.x.
Upgrade ESLint to version 9 or later.
Migrate to eslint.config.js.
Ensure the sql tag is named exactly sql; otherwise the rule will not flag untagged templates.
Review all template literals manually if high security is needed.
npm install eslint eslint-plugin-sql-template --save-dev
Switch to import syntax or downgrade to v2.
Upgrade to ESLint 9 and use eslint.config.js.
Use 'sql-template': sqlTemplate in plugins object.