ko-lint
raw JSON → 4.0.22 verified Fri May 01 auth: no javascript
ko-lint provides linting tools (ESLint, Prettier) for the DTStack/ko ecosystem. Current stable version is 4.0.22. It is a wrapper that enforces consistent lint configurations across ko projects. Key differentiator: tightly integrated with ko-script build system; ships TypeScript types. Release cadence is tied to ko releases. Transitive peer dependency on ko-lint-config.
Common errors
error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/node_modules/ko-lints/index.mjs not supported. ↓
cause CJS require used on ESM-only package.
fix
Change require() to import or upgrade Node.
error Module not found: Can't resolve 'ko-lint-config' ↓
cause Missing peer dependency ko-lint-config.
fix
npm install ko-lint-config
error TypeError: koLint is not a function ↓
cause Using deprecated default import that no longer exports a function.
fix
Use named exports like lint, format.
Warnings
breaking ko-lints v4 is ESM-only; CJS require fails. ↓
fix Use ESM imports (import { lint } from 'ko-lints') or upgrade to Node >=14.
deprecated Default export deprecated since v3, removed in v4. ↓
fix Use named exports.
gotcha ko-lint-config peer dependency must be manually installed. ↓
fix npm install ko-lint-config
Install
npm install ko-lints yarn add ko-lints pnpm add ko-lints Imports
- lint wrong
const lint = require('ko-lints')correctimport { lint } from 'ko-lints' - format
import { format } from 'ko-lints' - default wrong
import { default } from 'ko-lints'correctimport koLint from 'ko-lints'
Quickstart
import { lint, format } from 'ko-lints';
const files = ['src/**/*.ts'];
const lintResults = lint(files);
console.log('Lint issues:', lintResults);
format(files, { fix: true });