{"id":25846,"library":"ksql-lint","title":"ksql-lint","description":"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.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/thekiwi/ksql-lint","tags":["javascript","ksql","lint"],"install":[{"cmd":"npm install ksql-lint","lang":"bash","label":"npm"},{"cmd":"yarn add ksql-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add ksql-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency for parsing KSQL grammar","package":"antlr4","optional":false},{"reason":"CLI argument parsing","package":"commander","optional":false},{"reason":"File matching for input patterns","package":"glob","optional":false},{"reason":"Colored output for errors","package":"chalk","optional":false}],"imports":[{"note":"ksql-lint is primarily a CLI tool, not a library. No programmatic import is provided.","wrong":"npx ksql-lint --file ./path/*.ksql","symbol":"main (CLI)","correct":"npx ksql-lint ./path/*.ksql"},{"note":"ESM module; requires Node.js with ESM support or use dynamic import. CJS not supported.","wrong":"const { lint } = require('ksql-lint');","symbol":"lint (programmatic)","correct":"import { lint } from 'ksql-lint';"},{"note":"Default export is not provided; use named import for lint function. Other symbols may be internal.","wrong":"import * as ksql from 'ksql-lint';","symbol":"parseError / validate","correct":"import { lint } from 'ksql-lint';"}],"quickstart":{"code":"npx ksql-lint ./migrations/*.ksql","lang":"javascript","description":"Lint all .ksql files in the migrations directory using npx, output errors to console."},"warnings":[{"fix":"Regenerate parser using generate.sh with updated ANTLR version in package.json and Docker image.","message":"ANTLR version may cause compatibility issues: ksql-lint uses ANTLR 4.12. Updating requires regenerating the parser from grammar.","severity":"breaking","affected_versions":"1.0.0 - 1.0.1"},{"fix":"Ensure pipeline checks exit code; no additional action needed.","message":"Exit code 1 indicates linting errors, but does not halt execution; intended for CI.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use quoted glob patterns like '*.ksql'","message":"File glob patterns may not expand on all shells; quotes may be needed.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install locally: npm install antlr4","cause":"Missing antlr4 runtime dependency","error":"Error: Cannot find module 'antlr4'"},{"fix":"Use npx ksql-lint --grammar to check version; consider updating grammar","cause":"Parser can't handle some KSQL extensions or older grammar","error":"SyntaxError: Unexpected token (maybe from KSQL syntax)"},{"fix":"Run via npx or install globally: npm install -g ksql-lint","cause":"Package not installed","error":"ksql-lint: command not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}