diff --git a/package.json b/package.json index 97b2a7038..f61f4a8c8 100644 --- a/package.json +++ b/package.json @@ -13,12 +13,18 @@ "android-whitelabel": "npx react-native run-android --main-activity chat.rocket.reactnative.MainActivity --variant=experimentalPlayDebug --appId", "log-android": "react-native log-android", "snyk-protect": "snyk protect", - "precommit": "eslint . && jest", + "precommit": "lint-staged", "generate-source-maps-ios": "react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ios-release.bundle --sourcemap-output ios-release.bundle.map", "generate-source-maps-android": "bugsnag-sourcemaps", "postinstall": "patch-package && jetify", "prepare": "husky install" }, + "lint-staged": { + "*.{js,ts,tsx}": [ + "eslint", + "jest --bail --findRelatedTests" + ] + }, "dependencies": { "@codler/react-native-keyboard-aware-scroll-view": "^1.0.1", "@nozbe/watermelondb": "0.19.0", @@ -62,6 +68,7 @@ "i18n-js": "3.8.0", "js-base64": "3.6.1", "js-sha256": "^0.9.0", + "lint-staged": "^11.1.0", "lodash": "4.17.21", "moment": "2.29.1", "pretty-bytes": "5.6.0",