TP-56020 | Husky | Linting | Prettier Setup (#11128)
This commit is contained in:
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
yarn lint-staged
|
||||
@@ -21,10 +21,9 @@ const SelectCardWithDetailList = ({
|
||||
|
||||
const handleSelect = (itemType?: string) => {
|
||||
setSelectedItem(itemType);
|
||||
const item = widgetData?.items?.find(
|
||||
item => item?.itemType === itemType,
|
||||
);
|
||||
item?.analyticEvents?.onSelectedEvent && sendAsAnalyticsEvent(item?.analyticEvents?.onSelectedEvent)
|
||||
const item = widgetData?.items?.find(item => item?.itemType === itemType);
|
||||
item?.analyticEvents?.onSelectedEvent &&
|
||||
sendAsAnalyticsEvent(item?.analyticEvents?.onSelectedEvent);
|
||||
if (item?.dependentWidgets) {
|
||||
handleActions(
|
||||
item?.dependentWidgets,
|
||||
|
||||
@@ -2,7 +2,6 @@ import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
|
||||
import { NetworkConnectorModule } from "../App/common/native-module/NativeModules";
|
||||
import { BASE_URL } from "./NetworkConstant";
|
||||
|
||||
|
||||
export const getDefaultHeaderData = async () => {
|
||||
try {
|
||||
const data = await NetworkConnectorModule.getAllNativeHeaders();
|
||||
|
||||
16
package.json
16
package.json
@@ -5,7 +5,18 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "yarn react-native start",
|
||||
"bundle-size": "yarn run react-native-bundle-visualizer --entry-file ./index.android.js"
|
||||
"bundle-size": "yarn run react-native-bundle-visualizer --entry-file ./index.android.js",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,ts,tsx}": [
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.23.7",
|
||||
@@ -46,6 +57,9 @@
|
||||
"@types/react": "^18.2.16",
|
||||
"@types/react-native": "^0.72.2",
|
||||
"@types/react-test-renderer": "^18.0.0",
|
||||
"husky": "^8.0.0",
|
||||
"lint-staged": "^15.2.4",
|
||||
"prettier": "^3.2.5",
|
||||
"react-native-bundle-visualizer": "^2.2.0",
|
||||
"typescript": "^5.1.6"
|
||||
}
|
||||
|
||||
@@ -5988,4 +5988,4 @@ yazl@^2.5.1:
|
||||
yocto-queue@^0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz"
|
||||
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
|
||||
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
|
||||
Reference in New Issue
Block a user