{"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,"search_vec":"'/builder':38 '12.0.4':32 'angular':27,36,63,73,91,94 'angular-eslint':35 'appropri':23 'argument':49 'builder':30 'cli':24 'differenti':76 'elimin':77 'eslint':37 'expect':64 'file':15,43,61,82 'flag':45 'flat':58 'format':67 'handl':47 'javascript':93 'key':75 'lint':3,7,19,29,39,42,54,88,95,98 'lint-file-pattern':41 'lint-stag':18,53,87,97 'list':16,59 'manual':81 'map':83 'need':51,79 'newer':72 'ng':2,6 'ng-lint-stag':1,5 'option':25 'pattern':44 'project':92 'provid':56 'regular':68 'script':84 'shim':11 'specif':66 'stage':4,8,20,55,89,96,99 'support':33,71 'transform':13,50 'updat':69 'use':86 'version':31,74","created_at":"2026-05-01T13:47:36.181955+00:00","updated_at":"2026-05-01T13:47:36.181955+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/elunic/node-ng-lint-staged","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/ng-lint-staged","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}