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.

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').
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.
npm install stylelint-cli
yarn add stylelint-cli
pnpm add stylelint-cli

Uninstall global stylelint, install stylelint-cli globally, install local stylelint as dev dependency, then lint style.css.

npm uninstall -g stylelint && npm install -g stylelint-cli && cd my-project && npm install --save-dev stylelint && stylelint style.css