Registry / devops / umi3-plugin-lint

umi3-plugin-lint

JSON →
library1.0.2jsnpmunverified

Umi.js v3 plugin that integrates ESLint, Stylelint, Prettier, Husky, lint-staged, and commitlint into the build and development workflow. Provides commands to generate lint configuration files and run lint tasks. Currently at v1.0.2 with low release cadence (last update 2021). Requires umi@3.x as a peer dependency. Key differentiator: opinionated, one-stop lint setup for Umi projects, wrapping multiple tools under a unified plugin interface.

npm install umi3-plugin-lint
INSTALL
IMPORT
SIG · UMI3-PLUGIN-LINT
U
umi3-plugin-lint
devopsjavascriptv1.0.2
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.

default plugin function
// .umirc.ts export default { plugins: ['umi3-plugin-lint'] }
// common mistake: import { lintPlugin } from 'umi3-plugin-lint'
The plugin is used by adding its name to the 'plugins' array in Umi config; no explicit import in code.
commands
npx umi use-lint
// common mistake: npx use-lint (without 'umi')
The 'use-lint' command must be run via 'npx umi use-lint' to generate config files.
lint and format scripts
// package.json scripts automatically added "lint": "umi lint"
// common mistake: running eslint directly without umi wrapper
Run via npm scripts after plugin is enabled; they invoke 'umi lint' internally.

Installs the plugin, enables ESLint and Stylelint in config, runs use-lint to generate configuration files, and executes linting.

// 1. Install and add plugin npm install umi3-plugin-lint --save-dev // .umirc.ts export default { lint: { eslint: true, stylelint: true, }, plugins: ['umi3-plugin-lint'] } // 2. Generate lint configs npx umi use-lint // 3. Run lint npm run lint
Debug
Known issues
breakingOnly works with Umi 3.x; not compatible with Umi 4.
fix
Use Umi 4's built-in lint or alternative lint plugin.
affects: >=1.0.0
deprecatedPlugin has not been updated since 2021; may not support latest ESLint/Prettier versions.
fix
Pin dependency versions or migrate to separate linting setup.
affects: >=1.0.0
gotchaThe 'use-lint' command may override existing prettierrc/eslintrc files.
fix
Backup your config files before running 'npx umi use-lint'.
affects: >=1.0.0
gotchaHusky setup via use-lint may conflict with existing git hooks.
fix
Check .husky directory after generation; manually merge hooks.
affects: >=1.0.0
gotcha'@umijs/fabric' is not automatically installed; user must install it separately for recommended configs.
fix
Install '@umijs/fabric' as devDependency if needed.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'umi3-plugin-lint'
Plugin not installed or not listed in plugins config.
fix
Install with 'npm install umi3-plugin-lint --save-dev' and add to '.umirc.ts' plugins array.
Unknown command: use-lint
Command run outside Umi or plugin not registered.
fix
Ensure plugin is in '.umirc.ts' and run 'npx umi use-lint' (not 'npx use-lint').
Cannot find module 'eslint'
ESLint not installed; plugin expects user to install peer deps.
fix
Run 'npm install eslint --save-dev' and other needed linters.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
umirequiredpeer dependency (3.x) – plugin runs within Umi framework
Agent activity
2 hits · last 30 days
node
2
Resources
umi3-plugin-lint — npm install umi3-plugin-lint · libregistry