From 615f6170f4bd39630224c038d1ea5bf505d292af Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> Date: Mon, 25 Apr 2022 14:22:27 +0530 Subject: [PATCH] chore: add `lint-staged` for running the lint & test scripts (#1349) * chore(husky): add `pre-push` hook * feat: add `lint-staged` for running scripts * style: fix lint issue * chore: remove lint-staged as devDep * fix: remove pre-push hook Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> --- .husky/pre-commit | 3 +-- lint-staged.config.js | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 lint-staged.config.js diff --git a/.husky/pre-commit b/.husky/pre-commit index 660b8209689..d37daa075e2 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npm run lint -npm run test +npx --no-install lint-staged diff --git a/lint-staged.config.js b/lint-staged.config.js new file mode 100644 index 00000000000..ef1bc3a5b50 --- /dev/null +++ b/lint-staged.config.js @@ -0,0 +1,3 @@ +module.exports = { + '*.{js,ts}': 'npm run lint && npm test' +}