CILint

raw JSON →
0.0.21 verified Fri May 01 auth: no javascript maintenance

CILint is a team-oriented code linting tool for Git that focuses on checking only newly added lines during commits. Current stable version is 0.0.21. It integrates with ESLint for JavaScript syntax checking and Git hooks for team enforcement. Released sparsely, last update was in 2017. Unlike other linters that scan entire files, CILint only checks lines staged for commit, reducing noise and encouraging iterative improvements. It also supports automated initialization of configuration files and pre-commit hooks.

error Error: Cannot find module 'eslint'
cause ESLint is not installed in the same location as the package that requires it.
fix
Install ESLint locally: npm install eslint --save-dev or globally: npm install -g eslint
error cilint: command not found
cause cilint is not installed or not in PATH.
fix
Install locally with npm install cilint --save-dev and use npx: npx cilint --init or run from node_modules: ./node_modules/.bin/cilint
error Error: .cilintrc.js does not exist
cause Initialization has not been run.
fix
Run cilint --init or call initializer() programmatically.
breaking Version 0.0.14 changed how ESLint is resolved; CILint now searches for a local or global ESLint before falling back to its bundled version. Previously it always used the bundled ESLint.
fix Ensure ESLint and plugins are installed at the same level (e.g., both local or both global).
deprecated Requiring 'cilint' with require('cilint') returns an object; using require('cilint').default may be undefined. The main export is not a function but an object containing initializer and run.
fix Use const cilint = require('cilint'); then cilint.initializer() or cilint.run().
gotcha CILint only lints staged changes (currently in Git index), not the working tree. If files are not staged, no linting occurs.
fix Use 'git add' to stage files before committing, or run CILint manually on a file with `cilint file.js`.
breaking ESLint plugins must be at the same level as ESLint (both local or both global). Using global ESLint with local plugins will fail.
fix Install ESLint and plugins either all globally with `npm install -g eslint eslint-plugin-import` or all locally in your project.
npm install cilint
yarn add cilint
pnpm add cilint

Installs cilint, runs initializer to set up config files and pre-commit hook, then demonstrates code usage.

// Install locally
npm install cilint --save-dev

// Initialize configuration and pre-commit hook
import { initializer } from 'cilint';
initializer({
    override: true,
    cilintrcUrl: 'https://raw.githubusercontent.com/feix760/cilint/master/conf/cilintrc.js',
    eslintrcUrl: 'https://raw.githubusercontent.com/feix760/cilint/master/conf/eslintrc.js',
});

// Or via CLI:
// ./node_modules/.bin/cilint --init