joereynolds / joereynolds/sql-lint
linter is parsing keywords within strings
- Dominant language
- TypeScript
- Stars
- 459
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
The linter should ignore keywords inside properly quoted strings, here it's found the word `limit` inside a string which should not be invalid.
```js
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:
```json
[
{
source: '',
error: "[sql-lint: invalid-limit-quantifier] Argument 'sign' is not a valid quantifier for LIMIT clause.",
line: 1,
additionalInformation: ''
}
]
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.