Registry / devops / rush-lint-staged-plugin

rush-lint-staged-plugin

JSON →
library0.2.2jsnpmunverified

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.

npm install rush-lint-staged-plugin
INSTALL
IMPORT
SIG · RUSH-LINT-STAGED-P
R
rush-lint-staged-plugin
devopsjavascriptv0.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rush-lint-staged-plugin
npx rush lint-staged
require('rush-lint-staged-plugin')
This is a Rush plugin; it is invoked via the CLI command `rush lint-staged`, not imported directly.

Shows how to enable the Rush plugin, set up a pre-commit hook, add a placeholder config, and run lint-staged via Rush.

# Enable the plugin in rush-plugins.json: # { # "plugins": [ # { # "name": "rush-lint-staged-plugin", # "version": "0.2.2" # } # ] # } # Add a pre-commit hook (common/git-hooks/pre-commit): #!/bin/sh node common/scripts/install-run-rush.js lint-staged || exit $? # Add a placeholder config at repo root (.lintstagedrc.json): { "*": "echo ok" } # Create per-project .lintstagedrc files (e.g., apps/my-app/.lintstagedrc.js): module.exports = { "*.js": "eslint --fix" }; # Stage files and run: git add somefile.js rush lint-staged
Debug
Known issues
gotchaRequires a placeholder .lintstagedrc.json at monorepo root to avoid lint-staged misbehavior when only one config file exists.
fix
Add a .lintstagedrc.json file at the root with content: { "*": "echo ok" }.
affects: >=0.0.0
breakingRush >=5.57.0 is required; older versions do not support the Rush plugin system.
fix
Upgrade Rush to version 5.57.0 or later.
affects: <0.0.0
deprecatedThe plugin uses lint-staged's multi-config feature, which requires lint-staged >=12.2.1.
fix
Ensure lint-staged is at version 12.2.1 or later in your projects.
affects: >=0.0.0
Errors
Common errors & fixes
Rush: Plugin 'rush-lint-staged-plugin' is not found.
The plugin is not registered in rush-plugins.json or the version is incorrect.
fix
Add the plugin entry to common/config/rush/plugins.json with the correct name and version.
Error: ENOENT: no such file or directory, open '.lintstagedrc'
No lint-staged configuration found for a staged file.
fix
Ensure a .lintstagedrc file exists in the project root or add a placeholder at monorepo root.
lint-staged requires a minimum of Node.js 12
Node.js version is too old.
fix
Upgrade Node.js to version 12 or later.
Upgrade
Version history
0.2.2latest on npm
Audit
Dependencies
@rushstack/rush-plugin-manifestrequiredUsed to declare Rush plugin manifest.
Agent activity
6 hits · last 30 days
node
6
Resources
rush-lint-staged-plugin — npm install rush-lint-staged-plugin · libregistry