Registry / database / ksql-lint

ksql-lint

JSON →
library1.0.1jsnpmunverified

ksql-lint is a CLI tool for linting KSQLDB commands/queries, designed for use in CI/CD pipelines. It uses the official KSQLDB grammar from Confluent's ANTLR parser to validate KSQLDB statements syntax. The current version (1.0.1) is released under the MIT license. Key differentiators: direct grammar-based validation, simple CLI usage, exit codes for CI integration. It supports ANTLR 4.12 and is available via npx.

npm install ksql-lint
INSTALL
IMPORT
SIG · KSQL-LINT
K
ksql-lint
databasejavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

main (CLI)
npx ksql-lint ./path/*.ksql
npx ksql-lint --file ./path/*.ksql
ksql-lint is primarily a CLI tool, not a library. No programmatic import is provided.
lint (programmatic)
import { lint } from 'ksql-lint';
const { lint } = require('ksql-lint');
ESM module; requires Node.js with ESM support or use dynamic import. CJS not supported.
parseError / validate
import { lint } from 'ksql-lint';
import * as ksql from 'ksql-lint';
Default export is not provided; use named import for lint function. Other symbols may be internal.

Lint all .ksql files in the migrations directory using npx, output errors to console.

npx ksql-lint ./migrations/*.ksql
ksql-lint --version
Debug
Known issues
breakingANTLR version may cause compatibility issues: ksql-lint uses ANTLR 4.12. Updating requires regenerating the parser from grammar.
fix
Regenerate parser using generate.sh with updated ANTLR version in package.json and Docker image.
affects: 1.0.0 - 1.0.1
gotchaExit code 1 indicates linting errors, but does not halt execution; intended for CI.
fix
Ensure pipeline checks exit code; no additional action needed.
affects: >=1.0.0
gotchaFile glob patterns may not expand on all shells; quotes may be needed.
fix
Use quoted glob patterns like '*.ksql'
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'antlr4'
Missing antlr4 runtime dependency
fix
Install locally: npm install antlr4
SyntaxError: Unexpected token (maybe from KSQL syntax)
Parser can't handle some KSQL extensions or older grammar
fix
Use npx ksql-lint --grammar to check version; consider updating grammar
ksql-lint: command not found
Package not installed
fix
Run via npx or install globally: npm install -g ksql-lint
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
antlr4requiredRuntime dependency for parsing KSQL grammar
commanderrequiredCLI argument parsing
globrequiredFile matching for input patterns
chalkrequiredColored output for errors
Agent activity
2 hits · last 30 days
node
2
Resources
ksql-lint — npm install ksql-lint · libregistry