From 890996f5c9490888311211af42111c7f749eea38 Mon Sep 17 00:00:00 2001 From: allohamora Date: Sat, 24 Aug 2024 10:33:02 +0300 Subject: [PATCH] ci: add .ncurc.js for "npx npm-check-updates" --- .ncurc.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .ncurc.js diff --git a/.ncurc.js b/.ncurc.js new file mode 100644 index 0000000..ce7f995 --- /dev/null +++ b/.ncurc.js @@ -0,0 +1,22 @@ +const red = (log) => `\x1b[31m${log}\x1b[0m`; + +module.exports = { + deep: true, + upgrade: true, + + /** + * @description https://github.com/raineorshine/npm-check-updates?tab=readme-ov-file#filterresults + * @param {string} packageName + * @param {{ currentVersion: string, upgradedVersion: string }} versions + * @returns {boolean} + */ + filterResults: (packageName, { currentVersion, upgradedVersion }) => { + if (currentVersion.startsWith('^')) { + return true; + } + + console.warn(red(`${packageName}@${currentVersion} wasn't upgraded to ${upgradedVersion} because it is static`)); + + return false; + }, +};