Registry / devops / mrm-task-lint-staged

mrm-task-lint-staged

JSON →
library7.1.22jsnpmunverified

Mrm task that automates adding lint-staged configuration, pre-commit hooks, and dependencies to a JavaScript/TypeScript project. Version 7.1.22 is stable and maintained as part of the Mrm monorepo. Released alongside other Mrm tasks every few months. Supports ESLint, Prettier, and Stylelint; infers file extensions from existing npm scripts. Configures lint-staged within package.json and sets up a Git pre-commit hook using husky or similar. Offers customizable rules via the `lintStagedRules` option. Targeted at developers using Mrm for project scaffolding, contrasting with manual setup or other task runners.

npm install mrm-task-lint-staged
INSTALL
IMPORT
SIG · MRM-TASK-LINT-STAG
M
mrm-task-lint-staged
devopsjavascriptv7.1.22
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.

package.json
Run via `npx mrm lint-staged`
Requiring this package directly in code
Mrm tasks are run via the Mrm CLI, not imported directly. No JavaScript API to import.
mrm.config
import { config } from 'mrm-core'
import task from 'mrm-task-lint-staged'
task is not a module export; use mrm-core's config functions.
mrm.task
npx mrm lint-staged
import { lintStaged } from 'mrm-task-lint-staged'
No named exports; the task is invoked via CLI.

Run the Mrm task for lint-staged. This will create or update package.json with lint-staged config, install lint-staged, and set up a pre-commit hook. Requires npm scripts (e.g., 'lint') to infer rules. Custom rules can be passed via project config.

npx mrm lint-staged
Debug
Known issues
deprecatedInferring extensions from npm scripts may override manual changes on re-run.
fix
Use lintStagedRules option to explicitly set rules and prevent overwriting.
affects: >=1.0
gotchaOnly supports Prettier, ESLint, and Stylelint; other linters are not detected.
fix
Manually add custom rules via lintStagedRules option.
affects: all
gotchaTask assumes husky is used for Git hooks; other hook managers may not be set up automatically.
fix
Ensure husky is installed; otherwise, manually configure hooks.
affects: all
gotchaIf no npm lint scripts exist, no rules are added. Task will create empty config.
fix
Add relevant lint scripts before running the task, or specify rules via options.
affects: all
breakingVersion 7.x may have breaking changes from 6.x; check changelog for migration.
fix
Review CHANGELOG.md before upgrading.
affects: >=7.0
Errors
Common errors & fixes
No lint-staged rules were created after running `npx mrm lint-staged`
No lint scripts (e.g., 'eslint', 'prettier') detected in package.json.
fix
Add appropriate npm scripts, e.g., 'lint': 'eslint .', then re-run the task.
Error: Cannot find module 'mrm-core'
mrm-core not installed globally or locally.
fix
Install mrm-core: `npm install -g mrm-core` or `npx mrm-core lint-staged` (if bundled).
Error: Task 'lint-staged' is not found
mrm-task-lint-staged package not installed or mrm version incompatible.
fix
Install mrm and the task: `npm install -g mrm mrm-task-lint-staged`.
Upgrade
Version history
7.1.22latest on npm
Audit
Dependencies
mrm-corerequiredCore Mrm library required for config file editing and dependency installation.
Agent activity
2 hits · last 30 days
node
2
Resources
mrm-task-lint-staged — npm install mrm-task-lint-staged · libregistry