Registry / devops / cnp-lint

cnp-lint

JSON →
library2.1.5jsnpmunverified

A CLI tool (v2.1.5, updated 2024) to bootstrap linting configurations for front-end Git repositories. Integrates ESLint, Stylelint, Commitlint, npmpackagejsonlint, Prettier, and markdownlint with sensible defaults. Ships TypeScript types. Requires Node.js >=18. It is part of the create-npm-packages monorepo, designed for quick setup of consistent lint standards, though adoption is low (~100 monthly downloads).

npm install cnp-lint
INSTALL
IMPORT
SIG · CNP-LINT
C
cnp-lint
devopsjavascriptv2.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli
npx cnp-lint
npm install -g cnp-lint && cnp-lint
Use npx to avoid global install; v2.0+ requires Node >=18.
config (eslint)
// .eslintrc.js or in package.json: "eslintConfig": { "extends": "./node_modules/cnp-lint/eslintrc.json" }
require('cnp-lint/eslintrc.json')
ESLint config is a JSON file, not imported as a module.
config (stylelint)
// .stylelintrc.js or in package.json: "stylelint": { "extends": "./node_modules/cnp-lint/stylelintrc.json" }
import stylelintConfig from 'cnp-lint/stylelintrc.json'
Stylelint config is JSON, not a JS module.

Runs the interactive CLI to set up ESLint, Stylelint, Commitlint, and Prettier configurations for a front-end project.

npx cnp-lint
Debug
Known issues
breakingNode.js >=18 required from v2.0.0
fix
Upgrade Node.js to version 18 or higher.
affects: >=2.0.0
deprecatedGlobal installation is deprecated; use npx instead.
fix
Use npx cnp-lint instead of npm install -g cnp-lint && cnp-lint.
affects: >=2.0.0
gotchaConfig files are JSON, not JS modules; direct require/import may fail.
fix
Refer to configs via file path in your linter config, e.g., extends: './node_modules/cnp-lint/eslintrc.json'.
affects: >=1.0.0
gotchaLow download count (~100/month); community support is limited.
fix
Consider using eslint-config-prettier or other widely adopted alternatives for better support.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'cnp-lint/eslintrc.json'
The config file is not exported as a module; incorrect import syntax.
fix
Use file path reference in ESLint config: extends: './node_modules/cnp-lint/eslintrc.json' (or the path from your project root).
Node.js version 14.x is not supported, you must upgrade to Node >=18
cnp-lint v2 requires Node >=18.
fix
Upgrade Node.js to version 18 or later.
Command 'cnp-lint' not found after global install
Global install may not add to PATH or is deprecated.
fix
Use npx cnp-lint instead of global install.
Upgrade
Version history
2.1.5latest on npm
Audit
Dependencies
@commitlint/config-conventionaloptionalCommitlint configuration dependency
eslintrequiredCore linter peer dependency
stylelintrequiredCore style linter peer dependency
prettierrequiredFormatter integrated with ESLint/stylelint
Agent activity
6 hits · last 30 days
node
6
Resources
cnp-lint — npm install cnp-lint · libregistry