Replies: 1 comment
-
In my preset I added a workaround, which may/may not be suitable for the lint-staged task itself: const lintStaged = require('mrm-task-lint-staged');
const { lines } = require('mrm-core');
const task = () => {
// For every run of lint-staged, it appends "npx lint-staged" to pre-commit.
// This needs to happen only once and on subsequent runs the file should
// remain untouched
const preCommit = lines('.husky/pre-commit');
if (preCommit.exists()) {
preCommit.remove('npx lint-staged').save();
}
lintStaged({
... Happy to submit a PR with the above (or similar) if it's suitable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
lint-staged task appends
npx lint-staged
to.husky/pre-commit
every time it runs which renders it unsuitable for running more than once. To reproduce:Results are the same if I use
npx mrm lint-staged
instead ofnpx mrm@2 lint-staged
.My understanding is that mrm is meant to handle configuration upgrades so running
npx mrm@2 lint-staged
a second time should have resulted in no changes as there is nothing to upgrade.Beta Was this translation helpful? Give feedback.
All reactions