Skip to content

Commit c26264d

Browse files
committed
chore: add precommit and prepush
1 parent 80d90cf commit c26264d

19 files changed

Lines changed: 209 additions & 102 deletions

.eslintrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"ignorePatterns": ["lib", "/utils", "/hooks", "/contexts", "/components", "/primitives", "/index.js", "index.d.ts", "/stories", "/example-app", "/storybook-static"],
44
"rules": {
55
"import/no-extraneous-dependencies": 0,
6-
"react/boolean-prop-naming": 0
6+
"react/boolean-prop-naming": 0,
7+
"unicorn/expiring-todo-comments": 0,
8+
"@typescript-eslint/sort-type-union-intersection-members": 0
79
}
810
}

.github/workflows/publish-auto.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
npm_token: ${{ secrets.npm_token }}
2424
with:
2525
description: Autorelease
26-
release_type: patch
26+
release_type: patch

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2828
- uses: actions/checkout@v3
2929
id: checkout
30-
30+
3131
- uses: pnpm/action-setup@v2
3232

3333
- name: Setup Node.js environment
@@ -55,7 +55,7 @@ jobs:
5555
steps:
5656
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
5757
- uses: actions/checkout@v3
58-
58+
5959
- uses: pnpm/action-setup@v2
6060

6161
- name: Setup Node.js environment
@@ -85,7 +85,7 @@ jobs:
8585
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
8686
- uses: actions/checkout@v3
8787
id: checkout
88-
88+
8989
- uses: pnpm/action-setup@v2
9090

9191
- name: Setup Node.js environment
@@ -115,7 +115,7 @@ jobs:
115115
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
116116
- uses: actions/checkout@v3
117117
id: checkout
118-
118+
119119
- uses: pnpm/action-setup@v2
120120

121121
- name: Setup Node.js environment
@@ -130,4 +130,4 @@ jobs:
130130
run: pnpm install --frozen-lockfile
131131

132132
- name: Lint
133-
run: pnpm lint-only
133+
run: pnpm lint-only

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
pnpm lint-staged

.husky/pre-push

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
pnpm test

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
"build-storybook": "build-storybook",
2929
"release": "yarn test && npx release-it"
3030
},
31+
"lint-staged": {
32+
"*.ts": "eslint --fix",
33+
"*.js": "eslint --fix",
34+
"*.json": "eslint --fix",
35+
"*.graphql": "eslint --fix",
36+
"*.yml": "eslint --fix"
37+
},
3138
"publishConfig": {
3239
"access": "public",
3340
"registry": "https://registry.npmjs.org/"
@@ -92,6 +99,7 @@
9299
"jest": "27",
93100
"jest-expo": "^45.0.1",
94101
"jwt-decode": "^3.1.2",
102+
"lint-staged": "^13.2.3",
95103
"lodash": "^4.17.21",
96104
"react": "17",
97105
"react-dom": "17",

pnpm-lock.yaml

Lines changed: 168 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/GenericError.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable react/destructuring-assignment */
12
import { MaterialCommunityIcons } from '@expo/vector-icons'
23
import React, {
34
useContext,

src/components/NativePortal.ios.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export const NativePortal: React.FC<Props> = ({
2121
return (
2222
<Portal>
2323
<FullWindowOverlay
24-
pointerEvents={pointerEvents}
24+
// @ts-expect-error not sure why this is happening
25+
pointerEvents={pointerEvents as unknown}
2526
style={style}
2627
>
2728
{ children }

src/components/RefetchControl.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55

66
import type { RefreshControlProps } from 'react-native'
77

8-
type Props = Omit<RefreshControlProps, 'onRefresh' | 'refreshing'> & {
9-
readonly onRefetch: (() => Promise<unknown> | unknown) | undefined,
8+
type Props<T = unknown> = Omit<RefreshControlProps, 'onRefresh' | 'refreshing'> & {
9+
readonly onRefetch: (() => Promise<T> | T) | undefined,
1010
readonly onStatusChange?: (isLoading: boolean) => void,
1111
}
1212

0 commit comments

Comments
 (0)