Socket
Socket
Sign inDemoInstall

ut-tsql-lexer

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ut-tsql-lexer

Transact SQL lexer and linter


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

1.5.4 (2023-09-29)

Bug Fixes

  • add throw keyword (7d33867)

Readme

Source

Transact SQL lexer and linter

API

try {
    let parsed = require('ut-tsql-lexer').parse('select * FROM someTable');
    parsed.lint.forEach(({
        startLine,
        startColumn,
        endLine,
        endColumn,
        code,
        message,
        text
    }) => {
        // process lint warnings
    });

    parsed.tokens.forEach(line => {
        line.forEach(({
            type, // whitespace, newline, comment, literal, system, globaltemp,
                  // temp, variable, keyword, word, paren, operator
            text,
            location
        }) => {
            // process tokens of each line of source code
        });
    });
} catch ({message, location}) {
    // process parse errors
}

Lint rules

  • upppercase-keywords: Keywords must be in uppercase
  • no-doublequotes: Must use [...] instead of "..."
  • indent-size: Indentation must be multiple of 4
  • no-trailing-whitespace: Trailing whitespace not allowed
  • single-whitespace: Non indentation should be with single space
  • newline-required: Newline required at end of file
  • whitespace-around: Operator should be surrounded with single space
  • whitespace-after: Operator should be followed by single space
  • indent-step: Indentation step must not exceed 4
  • indent-same: Lines starting with non-keyword must have same indentation
  • indent-increase: Lines starting with non-keyword after lines starting with keyword must increase indentation
  • indent-after-begin: Line after BEGIN must increase indentation with 4

FAQs

Last updated on 29 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc