ESLint plugin for compile-time SQL query validation against your PostgreSQL database schema. Version 1.13.5 validates raw SQL strings within Slonik SQL tags (sql.array, sql.fragment, sql.identifier, etc.) at lint time, catching errors before runtime. A fork of @ts-safeql/eslint-plugin with native Slonik support. Requires libpg-query as peer dependency. Patches are released regularly, but the plugin is stable with full feature coverage for Slonik's tag builders.
npm install eslint-plugin-slonikNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows flat config setup with database URL from env and Slonik SQL tag validation example.
Use import slonik from 'eslint-plugin-slonik' in flat config; switch from .eslintrc to eslint.config.js.
Run: npm install libpg-query --save-dev
Migrate to eslint.config.js flat config as shown in quickstart.
Always set databaseUrl or use DATABASE_URL environment variable; check ESLint logs for warning.
Use 'slonik/check-sql' as rule key.
Run: npm install libpg-query --save-dev
Use import slonik from 'eslint-plugin-slonik' with flat config.
Ensure plugins: { slonik } is set and rule key is 'slonik/check-sql'.Set databaseUrl in config or export DATABASE_URL environment variable.