Registry / testing / eslint-plugin-sequel

eslint-plugin-sequel

JSON →
library1.9.10jsnpmunverified

An ESLint plugin providing lint rules for inline SQL in JavaScript and TypeScript code. Current stable version is 1.9.10, released on npm. It helps catch common SQL mistakes (e.g., missing WHERE clauses, LIKE misuse) directly in your codebase. Unlike other SQL linting tools, it integrates seamlessly with ESLint workflows and supports various SQL dialects. Release cadence is irregular, with maintenance updates as needed.

npm install eslint-plugin-sequel
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-SEQU
E
eslint-plugin-sequel
testingjavascriptv1.9.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
✓ // In .eslintrc.js module.exports = { plugins: ['sequel'], rules: { 'sequel/no-unsafe-query': 'error', }, };
✗ // Incorrect: expecting a default import import plugin from 'eslint-plugin-sequel';
The plugin is used as an ESLint plugin, not imported directly in code. It adds custom rules under 'sequel/' prefix.
rules
✓ // Using rules via ESLint config 'sequel/missing-where': 'warn'
✗ // Wrong: trying to require rules individually const missingWhere = require('eslint-plugin-sequel/rules/missing-where');
Rules are accessed via the plugin namespace in ESLint config, not directly as modules.
configs
✓ // Extending recommended config module.exports = { extends: ['plugin:sequel/recommended'], };
✗ // Wrong: expecting direct require of config object const config = require('eslint-plugin-sequel/configs/recommended');
Configs are exposed via the plugin's 'configs' property but should be used via ESLint's 'extends' with 'plugin:' prefix.

Shows how to set up the plugin in ESLint flat config or traditional .eslintrc, enabling SQL lint rules.

// eslint.config.js module.exports = [ { plugins: { sequel: require('eslint-plugin-sequel'), }, rules: { 'sequel/no-unsafe-query': 'error', 'sequel/missing-where': 'warn', }, }, ]; // or with Flat Config: // import sequel from 'eslint-plugin-sequel'; // export default [ sequel.configs.recommended ];
Debug
Known issues
gotchaRules only apply to template literals tagged with sql, not generic SQL strings.
fix
Ensure your SQL queries are written as tagged template literals: sql`SELECT * FROM users WHERE id = ${id}`
affects: >=1.0.0
gotchaThe plugin does not detect SQL in regular strings or concatenated strings.
fix
Refactor SQL strings to tagged template literals using the sql tag.
affects: >=1.0.0
gotchaSome rules may require specific SQL dialect configuration (e.g., MySQL vs PostgreSQL).
fix
Set the 'dialect' option in rule configuration: 'sequel/no-unsafe-query': ['error', { dialect: 'mysql' }]
affects: >=1.0.0
deprecatedThe 'sequel/no-parameterized-query' rule is deprecated in favor of better analysis.
fix
Remove the rule from your config or replace with 'sequel/no-unsafe-query'.
affects: >=1.7.0
gotchaFlat config support was added in v1.9.0; previous versions only work with .eslintrc.
fix
If using ESLint flat config (eslint.config.js), upgrade to v1.9.0+.
affects: <1.9.0
Errors
Common errors & fixes
Error: Failed to load plugin 'sequel' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-sequel'
Plugin not installed or missing from node_modules.
fix
npm install eslint-plugin-sequel --save-dev
Definition for rule 'sequel/no-unsafe-query' was not found
Plugin not properly registered in ESLint plugins section.
fix
Add 'plugins: ["sequel"]' to your ESLint config.
Parsing error: Unexpected token at "sql`SELECT * FROM users`"
ESLint is not configured to parse template literals with tagging; may need babel-eslint or @typescript-eslint/parser.
fix
Install and configure a parser like @typescript-eslint/parser if using TypeScript, or babel-eslint for JavaScript.
Upgrade
Version history
1.9.10latest on npm
Audit
Dependencies
eslintrequiredPeer dependency - ESLint is required to load and run the plugin.
Agent activity
7 hits · last 30 days
node
6
Resources
eslint-plugin-sequel — npm install eslint-plugin-sequel · libregistry