stylelint-cli
raw JSON → 1.3.0 verified Sat Apr 25 auth: no javascript maintenance
Global CLI wrapper to execute a locally installed stylelint. Stable version 1.3.0, released on npm. Low release cadence (last release 2019). Differentiator: allows running local stylelint via global `stylelint` command, avoiding conflicts between globally and locally installed stylelint. Alternative to npx-style invocations.
Common errors
error Cannot find module 'stylelint' ↓
cause stylelint not installed locally or globally after uninstalling global stylelint.
fix
Run
npm install --save-dev stylelint in the project directory. error ReferenceError: stylelint is not defined ↓
cause Trying to require stylelint-cli as a module instead of using the CLI.
fix
Use the CLI command
stylelint globally, not require('stylelint-cli'). Warnings
gotcha stylelint must be installed locally in the project directory; otherwise the CLI will fail. ↓
fix Run `npm install --save-dev stylelint` in your project root.
deprecated No new releases since 2019; consider using npx stylelint or direct local invocation. ↓
fix Run `npx stylelint` or `./node_modules/.bin/stylelint`.
breaking Drop Node 6 support in v1.2.0. ↓
fix Upgrade Node to version 8 or higher.
Install
npm install stylelint-cli yarn add stylelint-cli pnpm add stylelint-cli Quickstart
npm uninstall -g stylelint && npm install -g stylelint-cli && cd my-project && npm install --save-dev stylelint && stylelint style.css