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-stagedNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
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.
Use lintStagedRules option to explicitly set rules and prevent overwriting.
Manually add custom rules via lintStagedRules option.
Ensure husky is installed; otherwise, manually configure hooks.
Add relevant lint scripts before running the task, or specify rules via options.
Review CHANGELOG.md before upgrading.
Add appropriate npm scripts, e.g., 'lint': 'eslint .', then re-run the task.
Install mrm-core: `npm install -g mrm-core` or `npx mrm-core lint-staged` (if bundled).
Install mrm and the task: `npm install -g mrm mrm-task-lint-staged`.