mrm-task-lint-staged
Mrm task that adds lint-staged
Last updated 4 years ago by sapegin .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install mrm-task-lint-staged 
SYNC missed versions from official npm registry.

mrm-task-lint-staged

Mrm task that adds lint-staged.

Note: supports only Prettier, ESLint and Stylelint now, pull requests are welcome.

What it does

  • Creates a config in package.json
  • Sets up a pre-commit Git hook
  • Installs dependencies

This tasks will try to infer extensions from your npm scripts. For example, if you have lint script that runs ESLint for js and ts files, the task will add lint-staged rule that runs ESLint for the same extensions. And will overwrite an existing rule if you change it manually and run the task again, but it will try to keepy your custom rules.

Usage

npx mrm lint-staged

Options

See Mrm docs and lint-staged docs for more details.

lintStagedRules (default: infer)

Overrides and custom rules. By default will try to infer by project dependencies.

For example, a custom extension:

{
  "lintStagedRules": {
    "eslint": {
      "extensions": ["js", "jsx", "mjs"]
    }
  }
}

Or a custom command:

{
  "lintStagedRules": {
    "eslint": {
      "command": "eslint --fix"
    }
  }
}

Or you can disable one of the default rules:

{
  "lintStagedRules": {
    "prettier": {
      "enabled": false
    }
  }
}

Or add a custom rule:

{
  "lintStagedRules": {
    "jest": {
      "extensions": ["js"],
      "command": "jest --bail --findRelatedTests"
    }
  }
}

Available rules are prettier, eslint and stylelint.

Changelog

The changelog can be found in CHANGELOG.md.

Contributing

Everyone is welcome to contribute. Please take a moment to review the contributing guidelines.

Authors and license

Artem Sapegin and contributors.

MIT License, see the included License.md file.

Current Tags

  • 7.1.22                                ...           latest (a year ago)

57 Versions

  • 7.1.22                                ...           a year ago
  • 7.1.21                                ...           a year ago
  • 7.1.20                                ...           a year ago
  • 7.1.19                                ...           a year ago
  • 7.1.18                                ...           a year ago
  • 7.1.17                                ...           a year ago
  • 7.1.16                                ...           a year ago
  • 7.1.15                                ...           a year ago
  • 7.1.14                                ...           2 years ago
  • 7.1.13                                ...           2 years ago
  • 7.1.12                                ...           2 years ago
  • 7.1.11                                ...           2 years ago
  • 7.1.10                                ...           2 years ago
  • 7.1.9                                ...           2 years ago
  • 7.1.8                                ...           2 years ago
  • 7.1.7                                ...           2 years ago
  • 7.1.6                                ...           2 years ago
  • 7.1.5                                ...           2 years ago
  • 7.1.4                                ...           2 years ago
  • 7.1.3                                ...           2 years ago
  • 7.1.2                                ...           2 years ago
  • 7.1.1                                ...           2 years ago
  • 7.1.0                                ...           2 years ago
  • 7.0.0                                ...           3 years ago
  • 6.0.8                                ...           3 years ago
  • 6.0.7                                ...           3 years ago
  • 6.0.6                                ...           3 years ago
  • 6.0.5                                ...           3 years ago
  • 6.0.4                                ...           3 years ago
  • 6.0.3                                ...           3 years ago
  • 6.0.2                                ...           3 years ago
  • 6.0.0                                ...           4 years ago
  • 5.0.0                                ...           4 years ago
  • 4.0.0                                ...           4 years ago
  • 3.1.0                                ...           4 years ago
  • 3.0.15                                ...           4 years ago
  • 3.0.14                                ...           4 years ago
  • 3.0.13                                ...           4 years ago
  • 3.0.12                                ...           4 years ago
  • 3.0.11                                ...           4 years ago
  • 3.0.10                                ...           4 years ago
  • 3.0.9                                ...           4 years ago
  • 3.0.8                                ...           4 years ago
  • 3.0.7                                ...           4 years ago
  • 3.0.6                                ...           4 years ago
  • 3.0.5                                ...           5 years ago
  • 3.0.4                                ...           5 years ago
  • 3.0.3                                ...           5 years ago
  • 3.0.2                                ...           5 years ago
  • 3.0.1                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.4.1                                ...           6 years ago
  • 1.4.0                                ...           6 years ago
  • 1.3.1                                ...           6 years ago
  • 1.3.0                                ...           7 years ago
  • 0.0.1-security                                ...           7 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE