base-lint scans repositories for usage of modern Web Platform features and evaluates them against the Baseline dataset to ensure new features ship with fallbacks. Version 1.2.1 is current, with active maintenance and a GitHub Action for CI integration. Key differentiators include diff-mode analysis (default), Markdown and JSON reports, threshold-based enforcement (base-lint enforce), GitHub Checks annotation (base-lint annotate), and PR comment creation (base-lint comment). It relies on @typescript-eslint/typescript-estree for parsing TypeScript/JavaScript, requiring Node.js 18.17+ or 20.x LTS. Alternatives like Lighthouse or caniuse require external dataset integration, whereas base-lint provides an out-of-the-box CLI with built-in Baseline compliance tooling.
npm install base-lintNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic usage of init, scan, enforce, and clean functions with ESM imports.
Use import instead of require; for CommonJS projects, upgrade to Node.js 20+ and use dynamic import or await import().
Replace '--action' with '--github-action' when scaffolding GitHub Action workflow.
Ensure all changes are staged (git add) before running base-lint scan, or use --mode=repo for full codebase scan.
Remove any cache configuration from .base-lintrc.json; manual caching via CI artifacts is still possible.
Check @typescript-eslint/typescript-estree peer dependency version and keep TypeScript within supported range (≤5.4.x).
Switch to ESM (type: module in package.json) and use import statements, or use dynamic import: const baseLint = await import('base-lint');Stage changes with git add before running scan, or pass --mode=repo for full scan.
Run npm install --save-dev @types/base-lint (note: typings may be bundled in future versions).