From 8f102deae8990c1ed68b88e0258f46e83f8cfc9d Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Wed, 22 Mar 2023 21:14:52 +0000 Subject: [PATCH] fix: always use . when bump a specific package #4 --- .husky/pre-commit | 2 +- lint-staged.config.cjs => lint-staged.config.js | 2 +- main.js | 2 +- package.json | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) rename lint-staged.config.cjs => lint-staged.config.js (62%) diff --git a/.husky/pre-commit b/.husky/pre-commit index 36af2198..456c09ad 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx lint-staged +npm run staged diff --git a/lint-staged.config.cjs b/lint-staged.config.js similarity index 62% rename from lint-staged.config.cjs rename to lint-staged.config.js index 64fb0f0a..c31ef045 100644 --- a/lint-staged.config.cjs +++ b/lint-staged.config.js @@ -1,3 +1,3 @@ -module.exports = { +export default { '*.js': ['standard --fix'] } diff --git a/main.js b/main.js index c1df3c0d..3f84915d 100644 --- a/main.js +++ b/main.js @@ -69,7 +69,7 @@ function lib ({ process.chdir(path) // We've already cd'd into the directory, so just use . (cur directory) // This is ultimately passed to `git log` which runs in cwd - commitsOnPath = bumpTo ? undefined : '.' + commitsOnPath = '.' } const tagPrefix = getPrefix(prefix) diff --git a/package.json b/package.json index 13827421..0d034fa9 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "format": "standard --fix .", "prepare": "husky install", + "staged": "lint-staged -c ./lint-staged.config.js", "test": "vitest" }, "dependencies": {