Registry / devops / libdenolint

libdenolint

JSON →
library2.0.14jsnpmunverified

libdenolint v2.0.14 is a Deno lint library binding for Node.js, providing a native (N-API/Rust) interface to deno_lint for linting JavaScript/TypeScript files. It offers both async and sync APIs, supports ESLint-like configuration via .denolint.json (files.include/exclude, rule tags), eslint-disable comments, custom ignore patterns, and AbortSignal. Unlike @node-rs/deno-lint, it adds flexibility: scanning specific directories, merging CLI and config ignores, and pretty/compact output. Released as semver, compatible with Node >= 12.

npm install libdenolint
INSTALL
IMPORT
SIG · LIBDENOLINT
L
libdenolint
devopsjavascriptv2.0.14
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.

denolint
import { denolint } from 'libdenolint'
const { denolint } = require('libdenolint')
ESM-only package. For CommonJS, use dynamic import: const { denolint } = await import('libdenolint').
lint
import { lint } from 'libdenolint'
Same ESM-only caveat as denolint. lint takes (filepath: string, source: string | Buffer) and returns Promise<Warning[]>.
denolintSync
import { denolintSync } from 'libdenolint'
lintSync
import { lintSync } from 'libdenolint'

Demonstrates async project-wide linting, async single-file linting, and sync single-file linting with libdenolint.

import { denolint } from 'libdenolint'; import { readFile } from 'fs/promises'; import { lint, lintSync } from 'libdenolint'; // Async: lint entire project const allClean = await denolint(process.cwd(), '.denolint.json', { scanDirs: ['src'], ignorePatterns: ['**/*.test.js'] }); console.log('All files valid:', allClean); // Async: lint single file const src = await readFile('src/index.js'); const warnings = await lint('src/index.js', src); for (const w of warnings) console.warn(w); // Sync: lint single file const srcSync = require('fs').readFileSync('src/index.ts'); const warningsSync = lintSync('src/index.ts', srcSync); if (warningsSync.length) process.exitCode = 1;
Debug
Known issues
gotchaN-API prebuilds may not be available for all platforms/Node versions; compilation from source may fail if Rust toolchain is missing.
fix
Install @aspect-build/napi or use prebuilt binary from GitHub Releases if available.
affects: >=0.0.0
breakingIn v2, the return type of lint() changed from Warning[] to Warning[] (but the shape may differ). Config file format changed to match deno_lint >=0.6.0.
fix
Check changelog; ensure .denolint.json uses new fields (files.include, files.exclude, rules.tags, rules.exclude).
affects: >=2.0.0
deprecatedscanDirs and ignorePatterns parameters were added in v2, replacing old patterns. Old positional arguments may be removed.
fix
Update calls to denolint() to use options object with scanDirs and ignorePatterns.
affects: >=1.0.0 <2.0.0
gotchaeslint-disable comments work only with specific rule names; deno_lint may not support all ESLint rule names.
fix
Use deno_lint rule names (e.g., 'no-explicit-any', not 'no-console').
affects: >=0.0.0
gotchaAbortSignal support only for async methods; lintSync() ignores signal.
fix
Only pass signal to denolint() or lint(); use synchronous methods only when cancellation is not needed.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'libdenolint'
Missing or incorrect import in CommonJS context; package is ESM-only.
fix
Use dynamic import: const { denolint } = await import('libdenolint');
TypeError: lint is not a function
Importing wrong named export (e.g., lint from 'libdenolint/lint') or using default import.
fix
Import correctly: import { lint } from 'libdenolint';
SyntaxError: Invalid or unexpected token
Running ESM syntax (import) without proper package type module or .mjs extension.
fix
Add "type": "module" to package.json or rename file to .mjs.
Error: Failed to load config file .denolint.json: missing field 'files'
Config file uses old format without files.include/exclude.
fix
Update config to new format: { "files": { "include": ["src"], "exclude": [] }, "rules": {...} }
Upgrade
Version history
2.0.14latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
8
Resources
libdenolint — npm install libdenolint · libregistry