diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 8c178e97b4..0000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g' | { grep -E '(js|ts|tsx|json|yml|md|html|css)$' || true; }) - -if [ -z "$FILES" ]; then - exit 0 -fi - -TS_FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g' | { grep -E '(js|ts|tsx)$' || true; }) - -if [[ ! -z "$TS_FILES" ]];then - echo "Running lints" - npm run pre-commit:fix:code -- $TS_FILES -fi diff --git a/indexer/.subgraph.yaml b/indexer/.subgraph.yaml index 632d397622..5347cb7674 100644 --- a/indexer/.subgraph.yaml +++ b/indexer/.subgraph.yaml @@ -232,3 +232,4 @@ templates: handler: handleTransfer - event: Transfer(indexed address,indexed address,uint256) handler: handleTransfer + diff --git a/webapp/.husky/pre-commit b/webapp/.husky/pre-commit index 8c178e97b4..df66e6d837 100755 --- a/webapp/.husky/pre-commit +++ b/webapp/.husky/pre-commit @@ -1,15 +1,16 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" +cd ./webapp -FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g' | { grep -E '(js|ts|tsx|json|yml|md|html|css)$' || true; }) +FILES=$(git diff --cached --name-only --relative=webapp --diff-filter=ACMR | sed 's| |\\ |g' | { grep -E '(js|ts|tsx|json|yml|md|html|css)$' || true; }) if [ -z "$FILES" ]; then exit 0 fi -TS_FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g' | { grep -E '(js|ts|tsx)$' || true; }) +TS_FILES=$(git diff --cached --name-only --relative=webapp --diff-filter=ACMR | sed 's| |\\ |g' | { grep -E '(js|ts|tsx)$' || true; }) if [[ ! -z "$TS_FILES" ]];then echo "Running lints" npm run pre-commit:fix:code -- $TS_FILES -fi +fi \ No newline at end of file diff --git a/webapp/src/utils/test.tsx b/webapp/src/utils/test.tsx index 67889e7e64..cb9a0a5834 100644 --- a/webapp/src/utils/test.tsx +++ b/webapp/src/utils/test.tsx @@ -12,6 +12,7 @@ import { RootState } from '../modules/reducer' import { initTestStore } from '../modules/store' import * as locales from '../modules/translation/locales' +// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const allTranslations = mergeTranslations(flatten(en), flatten(locales.en) as any) export function renderWithProviders(