From ad15805d9bf72080ac7e4a6064ca8988efbe6565 Mon Sep 17 00:00:00 2001 From: Harry Dobrev Date: Wed, 28 Feb 2024 00:40:04 +0200 Subject: [PATCH 1/2] Update deprecated husky install See https://github.com/typicode/husky/releases/tag/v9.0.1 husky install is now deprecated and shows the following message install command is deprecated --- packages/mrm-task-lint-staged/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/mrm-task-lint-staged/index.js b/packages/mrm-task-lint-staged/index.js index 7902eef9..24bb08f7 100644 --- a/packages/mrm-task-lint-staged/index.js +++ b/packages/mrm-task-lint-staged/index.js @@ -11,7 +11,7 @@ const husky = require('husky'); const packages = { 'lint-staged': '>=10', - husky: '>=7', + husky: '>=9', }; /** @@ -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 @@ -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(); From 68ebc563853844ccb54851940b599b5418200791 Mon Sep 17 00:00:00 2001 From: Harry Dobrev Date: Wed, 28 Feb 2024 00:42:25 +0200 Subject: [PATCH 2/2] Update lint-staged snapshot for new husky init --- .../__snapshots__/index.spec.js.snap | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/mrm-task-lint-staged/__snapshots__/index.spec.js.snap b/packages/mrm-task-lint-staged/__snapshots__/index.spec.js.snap index 78a2b0dc..d0bb61ad 100644 --- a/packages/mrm-task-lint-staged/__snapshots__/index.spec.js.snap +++ b/packages/mrm-task-lint-staged/__snapshots__/index.spec.js.snap @@ -11,7 +11,7 @@ Object { \\"*.js\\": \\"eslint --cache --fix\\" }, \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" } }", } @@ -22,7 +22,7 @@ Object { "/package.json": "{ \\"name\\": \\"unicorn\\", \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" }, \\"devDependencies\\": { \\"eslint\\": \\"4.0.1\\", @@ -47,7 +47,7 @@ Object { \\"*.{js,css,md}\\": \\"prettier --write\\" }, \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" } }", } @@ -67,7 +67,7 @@ Object { ] }, \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" } }", } @@ -84,7 +84,7 @@ Object { \\"*.css\\": \\"stylelint --fix\\" }, \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" } }", } @@ -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\\": \\"*\\" @@ -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\\" @@ -138,7 +138,7 @@ Object { ] }, \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" } }", } @@ -149,7 +149,7 @@ Object { "/package.json": "{ \\"name\\": \\"unicorn\\", \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" }, \\"devDependencies\\": { \\"eslint\\": \\"*\\" @@ -172,7 +172,7 @@ Object { \\"*.js\\": \\"eslint --cache --fix\\" }, \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" } }", } @@ -190,7 +190,7 @@ Object { \\"*.js\\": \\"eslint --cache --fix\\" }, \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" } }", } @@ -207,7 +207,7 @@ Object { \\"*.js\\": \\"eslint --cache --fix\\" }, \\"scripts\\": { - \\"postinstall\\": \\"husky install\\", + \\"postinstall\\": \\"husky\\", \\"prepublishOnly\\": \\"pinst --disable\\", \\"postpublish\\": \\"pinst --enable\\" } @@ -227,7 +227,7 @@ Object { \\"*.js\\": \\"eslint --cache --fix\\" }, \\"scripts\\": { - \\"postinstall\\": \\"husky install\\" + \\"postinstall\\": \\"husky\\" } }", } @@ -244,7 +244,7 @@ Object { \\"*.{js,jsx}\\": \\"eslint --cache --fix\\" }, \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" } }", } @@ -261,7 +261,7 @@ Object { \\"*.scss\\": \\"stylelint --fix\\" }, \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" } }", } @@ -278,7 +278,7 @@ Object { \\"*.{js,jsx,mjs}\\": \\"prettier --write\\" }, \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" } }", } @@ -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\\": \\"*\\" @@ -312,7 +312,7 @@ Object { \\"*.{js,css,md}\\": \\"prettier --write\\" }, \\"scripts\\": { - \\"prepare\\": \\"husky install\\" + \\"prepare\\": \\"husky\\" } }", }