SQLint

raw JSON →
1.7.1 verified Fri May 01 auth: no javascript

SQLint is a lint tool for SQL with autofix support. It provides syntax checking and style enforcement for SQL files. Version 1.7.1 is the latest stable release. The tool is part of the sql-language-server project and can be used standalone or as an editor plugin. Release cadence is irregular with minor updates. Key differentiators include a built-in fix option (--fix) for automatic problem correction and support for personal/project configuration files. It supports multiple output formats (stylish, json) and can lint from stdin. The package ships TypeScript types and is actively maintained.

error Cannot find module 'sqlint'
cause Trying to require or import sqlint in Node.js code.
fix
SQLint is a CLI tool; install globally (npm install -g sqlint) or use npx.
gotcha SQLint is a CLI tool and cannot be imported programmatically as a library.
fix Use sqlint from the command line, either directly or via npx.
npm install sqlint
yarn add sqlint
pnpm add sqlint

Install SQLint as a dev dependency and lint a SQL query provided via stdin.

npm install sqlint --save-dev
echo "SELECT *
FROM foo
WHERE foo.a > 1" | npx sqlint --stdin