eslint-cli

raw JSON →
1.1.1 verified Sat Apr 25 auth: no javascript maintenance

A global CLI tool that finds and executes the local ESLint installation within a project. Version 1.1.1 is the latest stable release (2016); the package is in maintenance mode with no active development. It differentiates from alternatives by seamlessly running the project's local ESLint version when invoked globally, avoiding the need for npx or npm scripts. Designed for environments like WebStorm where global ESLint is not desired.

error Error: Cannot find module 'eslint'
cause Local eslint is not installed.
fix
Run 'npm install --save-dev eslint' in your project.
error eslint: command not found
cause eslint-cli is not installed globally or not in PATH.
fix
Run 'npm install -g eslint-cli'.
breaking Version 0.2.0 changed to run ESLint in the same process instead of spawning a child process. If you relied on child process behavior, your setup may break.
fix Update to >=0.2.0 and adapt any workarounds for child process.
gotcha When upgrading from an older version, you may see an installation error. Remove old eslint-cli first.
fix Run 'npm uninstall -g eslint-cli' then 'npm install -g eslint-cli'.
gotcha The eslint module must NOT be installed globally; eslint-cli must be global. If both are global, the wrong version may execute.
fix Ensure eslint is installed locally (npm install --save-dev eslint) and eslint-cli globally.
npm install eslint-cli
yarn add eslint-cli
pnpm add eslint-cli

Installs eslint-cli globally and local ESLint, then runs ESLint on the lib directory.

npm install -g eslint-cli
cd your-project
npm install --save-dev eslint
eslint lib/