{"id":25985,"library":"ng-lint-staged","title":"ng-lint-staged","description":"ng-lint-staged is a shim that transforms the file list from lint-staged into the appropriate CLI option for Angular's lint builder. Version 12.0.4 supports the @angular-eslint/builder:lint with --lint-file-patterns flag. It handles the argument transformation needed because lint-staged provides a flat list of files while Angular expects a specific format. Regularly updated to support newer Angular versions. Key differentiator: eliminates the need for manual file mapping scripts when using lint-staged with Angular projects.","status":"active","version":"12.0.4","language":"javascript","source_language":"en","source_url":"git://github.com/elunic/node-ng-lint-staged","tags":["javascript","angular","lint","staged","lint-staged"],"install":[{"cmd":"npm install ng-lint-staged","lang":"bash","label":"npm"},{"cmd":"yarn add ng-lint-staged","lang":"bash","label":"yarn"},{"cmd":"pnpm add ng-lint-staged","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM-only? Versions >=7.0.0 are CommonJS; but default import works.","wrong":"const ngLintStaged = require('ng-lint-staged')","symbol":"default","correct":"import ngLintStaged from 'ng-lint-staged'"},{"note":"The package is a CLI tool, not a library; no importable symbols. Use npx or add to lint-staged config.","symbol":"ngLintStaged or no named export?","correct":"npx ng-lint-staged lint --fix --"},{"note":"Must include trailing '--' to separate files list.","wrong":"\"src/**/*.ts\": [\"ng lint --fix --files\"]","symbol":"lint-staged config usage","correct":"\"src/**/*.ts\": [\"ng-lint-staged lint --fix --\"]"}],"quickstart":{"code":"// In package.json, add lint-staged configuration:\n// \"lint-staged\": {\n//   \"src/**/*.ts\": [\"ng-lint-staged lint --fix --\"]\n// }\n// Then run: npx lint-staged","lang":"javascript","description":"Configure lint-staged to use ng-lint-staged for linting staged .ts files with Angular CLI."},"warnings":[{"fix":"Update your lint-staged command: use 'ng-lint-staged lint --fix --' (no explicit flag needed).","message":"Version 12.0.0+ changed the CLI flag from --files to --lint-file-patterns (for eslint builder).","severity":"breaking","affected_versions":">=12.0.0"},{"fix":"If using tslint, stick with ng-lint-staged <7.0.0.","message":"Version 7.0.0+ dropped support for tslint builder (now only eslint).","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Always append '--' at the end of the ng-lint-staged command.","message":"Missing trailing '--' in the command will cause the files argument to be interpreted as part of the command.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure package.json has a 'lint' script that runs 'ng lint <project>'. Or specify a different script name after 'ng-lint-staged'.","message":"The command assumes an npm script named 'lint' exists. If your script is named differently, the command will fail.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Run 'npm outdated ng-lint-staged' to check for newer versions.","message":"Version 12.0.4 may be deprecated; check latest version.","severity":"deprecated","affected_versions":"12.0.4"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev ng-lint-staged' in your project.","cause":"ng-lint-staged is not installed globally or locally.","error":"Error: Cannot find module 'ng-lint-staged'"},{"fix":"Upgrade ng-lint-staged to >=12.0.0, or use --lint-file-patterns instead of --files.","cause":"Using older ng-lint-staged version with eslint builder.","error":"Unknown option: --files"},{"fix":"Ensure the command ends with '--' like: 'ng-lint-staged lint --fix --'","cause":"Missing '--' separator in the command.","error":"ng-lint-staged: lint-staged file list must be appended after '--'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}