{"id":26564,"library":"umi-lint","title":"umi-lint","description":"Configless lint tool that bundles eslint, tslint, stylelint, prettier, lint-staged, and husky into a single zero-config command-line interface. Version 2.0.2 is the latest stable release, with an active maintenance status. It simplifies code quality and formatting by reducing the number of dependencies and configuration files needed for a typical linting setup. Key differentiator: provides a unified CLI that supports linting entire directories, only staged files (via --staged), and integrates multiple linters and formatters with a single command.","status":"active","version":"2.0.2","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/umijs/umi-lint","tags":["javascript","eslint","husky","lint","lint-staged","prettier","stylelint"],"install":[{"cmd":"npm install umi-lint","lang":"bash","label":"npm"},{"cmd":"yarn add umi-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add umi-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Enables JavaScript/TypeScript linting when --eslint flag used","package":"eslint","optional":true},{"reason":"Code formatting when --prettier flag used","package":"prettier","optional":true},{"reason":"CSS/SCSS linting when --stylelint flag used","package":"stylelint","optional":true},{"reason":"Runs linters on staged git files via --staged","package":"lint-staged","optional":true},{"reason":"Git hooks setup for precommit integration","package":"husky","optional":true}],"imports":[{"note":"Not a JS library; used as a CLI tool via npx or from scripts in package.json.","wrong":"import umi-lint from 'umi-lint'","symbol":"umi-lint","correct":"npx umi-lint [options]"},{"note":"Can be required programmatically but primary use is CLI. Returns an object with lint methods.","wrong":"","symbol":"umi-lint (direct require)","correct":"const umiLint = require('umi-lint')"},{"note":"Default export is the programmatic API; named exports not available.","wrong":"import { umiLint } from 'umi-lint'","symbol":"umi-lint (ESM)","correct":"import umiLint from 'umi-lint'"}],"quickstart":{"code":"// Add to package.json scripts:\n\"lint\": \"umi-lint --eslint src/\",\n\"prepare\": \"umi-lint --staged --eslint --stylelint --prettier --fix\"\n\n// Run lint:\nnpm run lint","lang":"javascript","description":"Demonstrates how to configure umi-lint scripts in package.json for both full source linting and precommit staged file checks with auto-fix."},"warnings":[{"fix":"Create configuration files in project root as documented by each linter.","message":"umi-lint does not include its own configuration; you must create .eslintrc, .stylelintrc, and .prettierrc files manually.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use umi-lint --eslint --eslint.ext='.ts,.tsx' or pass options via dot notation: --eslint.ext='.ts,.tsx'.","message":"The --eslint flag does not automatically detect TypeScript files; you must specify --eslint.ext='.ts,.tsx' to lint TypeScript.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Run 'git add' to stage files before executing umi-lint --staged.","message":"When using --staged, the tool only lints files that are staged in git; ensure you have staged changes before running.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use --eslint instead of --tslint and configure eslint with @typescript-eslint/parser.","message":"tslint is bundled but deprecated by the TypeScript team; recommend using eslint with TypeScript parsers instead.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Ensure sub-parameters are passed with dots: --eslint.debug, -s.formatter=json, -p.no-semi.","message":"Options with sub-parameters must use dot notation, e.g., --eslint.debug or -s.formatter=json; incorrect syntax like --eslint-debug may be ignored.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Create .eslintrc file (e.g., .eslintrc.json) with basic configuration.","cause":"Missing .eslintrc file in project root","error":"Error: No eslint configuration found"},{"fix":"Run npm install umi-lint --save-dev or use npx umi-lint.","cause":"umi-lint not installed or not in node_modules","error":"Cannot find module 'umi-lint'"},{"fix":"Initialize git with 'git init' or run the command inside a git repository.","cause":"Not inside a git repository","error":"Error: --staged requires a git repository"},{"fix":"Use --eslint.ext '.ts,.tsx' or --eslint.ext=.ts,.tsx (no space before value) but prefer dot notation: --eslint.ext='.ts,.tsx'.","cause":"Using equals sign for sub-parameters instead of dot notation","error":"Error: Unknown option: --eslint.ext='.ts,.tsx'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}