Transact SQL lexer and linter that parses T-SQL source code into tokens and provides linting rules for code style and correctness. Version 1.5.4 is stable with moderate release cadence. It returns parsed tokens per line with types (whitespace, keyword, operator, etc.) and a lint array with rule violations. Key differentiators: built-in lint rules for uppercase keywords, indentation, whitespace, and quoting; detailed error messages with location.
npm install ut-tsql-lexerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates parsing T-SQL source code, accessing lint warnings, and iterating tokens per line with error handling.
Always iterate tokens as result.tokens.forEach(line => ...) and assume line is an array.
Wrap parse() in try-catch block.
Use the exact string 'upppercase-keywords' in configurations; future versions may fix the typo.
Use named import: import { parse } from 'ut-tsql-lexer'Wrap parse() in try-catch: try { const r = parse(sql); r.lint... } catch (e) { ... }Iterate as result.tokens.forEach(line => line.forEach(token => ...))
No dependency data recorded yet.