The linter should ignore keywords inside properly quoted strings, here it's found the word limit inside a string which should not be invalid.
const sqlLint = require('sql-lint').default;
const main = async function (sqlQuery) {
const SQLerrors = await sqlLint({ driver: "postgres", sql: sqlQuery });
console.log(SQLerrors);
}
main("INSERT INTO my_table (notes) VALUES ('speed limit sign');")
returns:
[
{
source: '',
error: "[sql-lint: invalid-limit-quantifier] Argument 'sign' is not a valid quantifier for LIMIT clause.",
line: 1,
additionalInformation: ''
}
]
The linter should ignore keywords inside properly quoted strings, here it's found the word
limitinside a string which should not be invalid.returns:
[ { source: '', error: "[sql-lint: invalid-limit-quantifier] Argument 'sign' is not a valid quantifier for LIMIT clause.", line: 1, additionalInformation: '' } ]