{"id":26350,"library":"rush-lint-staged-plugin","title":"Rush Lint-Staged Plugin","description":"A Rush.js plugin that integrates lint-staged into Rush monorepos, enabling per-project lint-staged configurations via the multi-config feature introduced in lint-staged >=12.2.1. Current stable version: 0.2.2. Released as part of TikTok's rush-plugins, with no fixed schedule. Key differentiator: automatically matches staged files to the nearest .lintstagedrc file in the monorepo, correcting working directories for tasks. Requires Rush >=5.57.0 and Node >=12.","status":"active","version":"0.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/tiktok/rush-plugins","tags":["javascript","rush","plugin","command"],"install":[{"cmd":"npm install rush-lint-staged-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add rush-lint-staged-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add rush-lint-staged-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used to declare Rush plugin manifest.","package":"@rushstack/rush-plugin-manifest","optional":false}],"imports":[{"note":"This is a Rush plugin; it is invoked via the CLI command `rush lint-staged`, not imported directly.","wrong":"require('rush-lint-staged-plugin')","symbol":"rush-lint-staged-plugin","correct":"npx rush lint-staged"}],"quickstart":{"code":"# Enable the plugin in rush-plugins.json:\n# {\n#   \"plugins\": [\n#     {\n#       \"name\": \"rush-lint-staged-plugin\",\n#       \"version\": \"0.2.2\"\n#     }\n#   ]\n# }\n\n# Add a pre-commit hook (common/git-hooks/pre-commit):\n#!/bin/sh\nnode common/scripts/install-run-rush.js lint-staged || exit $?\n\n# Add a placeholder config at repo root (.lintstagedrc.json):\n{\n  \"*\": \"echo ok\"\n}\n\n# Create per-project .lintstagedrc files (e.g., apps/my-app/.lintstagedrc.js):\nmodule.exports = {\n  \"*.js\": \"eslint --fix\"\n};\n\n# Stage files and run:\ngit add somefile.js\nrush lint-staged","lang":"javascript","description":"Shows how to enable the Rush plugin, set up a pre-commit hook, add a placeholder config, and run lint-staged via Rush."},"warnings":[{"fix":"Add a .lintstagedrc.json file at the root with content: { \"*\": \"echo ok\" }.","message":"Requires a placeholder .lintstagedrc.json at monorepo root to avoid lint-staged misbehavior when only one config file exists.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade Rush to version 5.57.0 or later.","message":"Rush >=5.57.0 is required; older versions do not support the Rush plugin system.","severity":"breaking","affected_versions":"<0.0.0"},{"fix":"Ensure lint-staged is at version 12.2.1 or later in your projects.","message":"The plugin uses lint-staged's multi-config feature, which requires lint-staged >=12.2.1.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add the plugin entry to common/config/rush/plugins.json with the correct name and version.","cause":"The plugin is not registered in rush-plugins.json or the version is incorrect.","error":"Rush: Plugin 'rush-lint-staged-plugin' is not found."},{"fix":"Ensure a .lintstagedrc file exists in the project root or add a placeholder at monorepo root.","cause":"No lint-staged configuration found for a staged file.","error":"Error: ENOENT: no such file or directory, open '.lintstagedrc'"},{"fix":"Upgrade Node.js to version 12 or later.","cause":"Node.js version is too old.","error":"lint-staged requires a minimum of Node.js 12"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}