web-code-lint
raw JSON → 1.0.0 verified Fri May 01 auth: no javascript
A one-stop code lint tool integrating ESLint 9 (flat config), Prettier, Stylelint, Husky, lint-staged, Commitlint, and Vue/TypeScript support. v1.0.0 requires Node.js >=20.19.0 and is installable globally via pnpm or npm. It auto-generates configurations and Git hooks for new projects, using the project's lock file to select the appropriate package manager. Key differentiators: bundled VSCode auto-format config, ESLint flat config support, and no runtime peer dependencies beyond the project's own development stack.
Common errors
error Error: The module was not found. ESLint couldn't find the plugin 'xxx'. ↓
cause Missing or incompatible peer dependency for ESLint plugin installed by init.
fix
Run
pnpm install (or npm/yarn) to ensure all plugins are installed. error eslint: command not found ↓
cause Global web-code-lint tries to use local ESLint but it hasn't been installed yet.
fix
Run
pnpm add eslint --save-dev in the project root first, or re-run web-code-lint init. error SyntaxError: Cannot use import statement outside a module ↓
cause ESLint flat config file (eslint.config.mjs) requires 'type: module' in package.json or .mjs extension, but the project may not have it set.
fix
Add
"type": "module" to package.json, or rename config to eslint.config.cjs as CommonJS fallback. Warnings
breaking Requires Node.js >=20.19.0; older versions will fail installation. ↓
fix Upgrade Node.js to >=20.19.0.
deprecated The init command overwrites existing lint configuration files without backup. ↓
fix Manually backup or commit your existing config before running init.
gotcha Husky hooks use npx --no-install to run lint-staged; ensure lint-staged is installed as a dev dependency by init. ↓
fix If hooks fail, run 'pnpm install' (or equivalent) in the project root after init.
gotcha VSCode ESLint extension requires 'eslint.useFlatConfig' setting enabled; the init script adds a .vscode/settings.json with this setting, but it may conflict with an existing settings file. ↓
fix Merge the generated .vscode/settings.json with your existing settings manually.
Install
npm install web-code-lint yarn add web-code-lint pnpm add web-code-lint Imports
- init wrong
const init = require('web-code-lint')correctimport { init } from 'web-code-lint' - lint wrong
import { lint } from 'web-code-lint'correctnpm run lint - lint:fix wrong
const lintFix = require('web-code-lint').lintFixcorrectnpm run lint:fix
Quickstart
pnpm add -g web-code-lint
cd /path/to/your/project
web-code-lint init
pnpm install
npm run lint