{"id":26566,"library":"umi3-plugin-lint","title":"umi3-plugin-lint","description":"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.","status":"maintenance","version":"1.0.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","umi","typescript"],"install":[{"cmd":"npm install umi3-plugin-lint","lang":"bash","label":"npm"},{"cmd":"yarn add umi3-plugin-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add umi3-plugin-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency (3.x) – plugin runs within Umi framework","package":"umi","optional":false}],"imports":[{"note":"The plugin is used by adding its name to the 'plugins' array in Umi config; no explicit import in code.","wrong":"// common mistake: import { lintPlugin } from 'umi3-plugin-lint'","symbol":"default plugin function","correct":"// .umirc.ts\nexport default { plugins: ['umi3-plugin-lint'] }"},{"note":"The 'use-lint' command must be run via 'npx umi use-lint' to generate config files.","wrong":"// common mistake: npx use-lint (without 'umi')","symbol":"commands","correct":"npx umi use-lint"},{"note":"Run via npm scripts after plugin is enabled; they invoke 'umi lint' internally.","wrong":"// common mistake: running eslint directly without umi wrapper","symbol":"lint and format scripts","correct":"// package.json scripts automatically added\n\"lint\": \"umi lint\""}],"quickstart":{"code":"// 1. Install and add plugin\nnpm install umi3-plugin-lint --save-dev\n\n// .umirc.ts\nexport default {\n  lint: {\n    eslint: true,\n    stylelint: true,\n  },\n  plugins: ['umi3-plugin-lint']\n}\n\n// 2. Generate lint configs\nnpx umi use-lint\n\n// 3. Run lint\nnpm run lint","lang":"typescript","description":"Installs the plugin, enables ESLint and Stylelint in config, runs use-lint to generate configuration files, and executes linting."},"warnings":[{"fix":"Use Umi 4's built-in lint or alternative lint plugin.","message":"Only works with Umi 3.x; not compatible with Umi 4.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Pin dependency versions or migrate to separate linting setup.","message":"Plugin has not been updated since 2021; may not support latest ESLint/Prettier versions.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Backup your config files before running 'npx umi use-lint'.","message":"The 'use-lint' command may override existing prettierrc/eslintrc files.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Check .husky directory after generation; manually merge hooks.","message":"Husky setup via use-lint may conflict with existing git hooks.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install '@umijs/fabric' as devDependency if needed.","message":"'@umijs/fabric' is not automatically installed; user must install it separately for recommended configs.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install with 'npm install umi3-plugin-lint --save-dev' and add to '.umirc.ts' plugins array.","cause":"Plugin not installed or not listed in plugins config.","error":"Error: Cannot find module 'umi3-plugin-lint'"},{"fix":"Ensure plugin is in '.umirc.ts' and run 'npx umi use-lint' (not 'npx use-lint').","cause":"Command run outside Umi or plugin not registered.","error":"Unknown command: use-lint"},{"fix":"Run 'npm install eslint --save-dev' and other needed linters.","cause":"ESLint not installed; plugin expects user to install peer deps.","error":"Cannot find module 'eslint'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}