eslint-plugin-sql icon indicating copy to clipboard operation
eslint-plugin-sql copied to clipboard

Should handle sql-formatter crashes and report with eslint

Open aeharding opened this issue 3 months ago • 0 comments

I noticed that when sql-formatter fails to format (malformed sql) it crashes eslint.

Instead, eslint-plugin-sql should probably catch the error, report and move on.

Example:

sql`SELECT hi !`

Output:

Oops! Something went wrong! :(

ESLint: 9.36.0

Error: Parse error: Unexpected "!" at line 1 column 11.
This likely happens because you're using the default "sql" dialect.
If possible, please select a more specific dialect (like sqlite, postgresql, etc).

[stacktrace]

aeharding avatar Sep 26 '25 16:09 aeharding