Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated husky install #339

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions packages/mrm-task-lint-staged/__snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Object {
\\"*.js\\": \\"eslint --cache --fix\\"
},
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
}
}",
}
Expand All @@ -22,7 +22,7 @@ Object {
"/package.json": "{
\\"name\\": \\"unicorn\\",
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
},
\\"devDependencies\\": {
\\"eslint\\": \\"4.0.1\\",
Expand All @@ -47,7 +47,7 @@ Object {
\\"*.{js,css,md}\\": \\"prettier --write\\"
},
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
}
}",
}
Expand All @@ -67,7 +67,7 @@ Object {
]
},
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
}
}",
}
Expand All @@ -84,7 +84,7 @@ Object {
\\"*.css\\": \\"stylelint --fix\\"
},
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
}
}",
}
Expand All @@ -95,7 +95,7 @@ exports[`should infer ESLint extension for an npm script 1`] = `
\\"name\\": \\"unicorn\\",
\\"scripts\\": {
\\"lint\\": \\"eslint --fix --ext .js,.jsx\\",
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
},
\\"devDependencies\\": {
\\"eslint\\": \\"*\\"
Expand All @@ -111,7 +111,7 @@ exports[`should infer Prettier extensions from an npm script 1`] = `
\\"name\\": \\"unicorn\\",
\\"scripts\\": {
\\"format\\": \\"prettier --write '**/*.{js,jsx}'\\",
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
},
\\"devDependencies\\": {
\\"prettier\\": \\"1.9.2\\"
Expand All @@ -138,7 +138,7 @@ Object {
]
},
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
}
}",
}
Expand All @@ -149,7 +149,7 @@ Object {
"/package.json": "{
\\"name\\": \\"unicorn\\",
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
},
\\"devDependencies\\": {
\\"eslint\\": \\"*\\"
Expand All @@ -172,7 +172,7 @@ Object {
\\"*.js\\": \\"eslint --cache --fix\\"
},
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
}
}",
}
Expand All @@ -190,7 +190,7 @@ Object {
\\"*.js\\": \\"eslint --cache --fix\\"
},
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
}
}",
}
Expand All @@ -207,7 +207,7 @@ Object {
\\"*.js\\": \\"eslint --cache --fix\\"
},
\\"scripts\\": {
\\"postinstall\\": \\"husky install\\",
\\"postinstall\\": \\"husky\\",
\\"prepublishOnly\\": \\"pinst --disable\\",
\\"postpublish\\": \\"pinst --enable\\"
}
Expand All @@ -227,7 +227,7 @@ Object {
\\"*.js\\": \\"eslint --cache --fix\\"
},
\\"scripts\\": {
\\"postinstall\\": \\"husky install\\"
\\"postinstall\\": \\"husky\\"
}
}",
}
Expand All @@ -244,7 +244,7 @@ Object {
\\"*.{js,jsx}\\": \\"eslint --cache --fix\\"
},
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
}
}",
}
Expand All @@ -261,7 +261,7 @@ Object {
\\"*.scss\\": \\"stylelint --fix\\"
},
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
}
}",
}
Expand All @@ -278,7 +278,7 @@ Object {
\\"*.{js,jsx,mjs}\\": \\"prettier --write\\"
},
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
}
}",
}
Expand All @@ -289,7 +289,7 @@ exports[`should use default JS extension if eslint command has no --ext key 1`]
\\"name\\": \\"unicorn\\",
\\"scripts\\": {
\\"lint\\": \\"eslint --fix\\",
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
},
\\"devDependencies\\": {
\\"eslint\\": \\"*\\"
Expand All @@ -312,7 +312,7 @@ Object {
\\"*.{js,css,md}\\": \\"prettier --write\\"
},
\\"scripts\\": {
\\"prepare\\": \\"husky install\\"
\\"prepare\\": \\"husky\\"
}
}",
}
Expand Down
6 changes: 3 additions & 3 deletions packages/mrm-task-lint-staged/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const husky = require('husky');

const packages = {
'lint-staged': '>=10',
husky: '>=7',
husky: '>=9',
};

/**
Expand Down Expand Up @@ -191,7 +191,7 @@ module.exports = function task({ lintStagedRules }) {
if (isUsingYarnBerry()) {
// Yarn 2 doesn't support `prepare` lifecycle yet
// https://yarnpkg.com/advanced/lifecycle-scripts
pkg.appendScript('postinstall', 'husky install');
pkg.appendScript('postinstall', 'husky');
if (!pkg.get('private')) {
// In case package isn't private, pinst ensures that postinstall
// is disabled on publish
Expand All @@ -202,7 +202,7 @@ module.exports = function task({ lintStagedRules }) {
}
} else {
// npm, Yarn 1, pnpm
pkg.appendScript('prepare', 'husky install');
pkg.appendScript('prepare', 'husky');
}

pkg.save();
Expand Down