Skip to content

Commit 71a964e

Browse files
WesSouzaarturbien
authored andcommitted
ci: add lint and type checking
This also fixes some remaining lint issues.
1 parent 5abcb3e commit 71a964e

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

.github/workflows/ci.yml

+52
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,58 @@ on:
44
pull_request:
55

66
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Git Checkout
11+
uses: actions/checkout@v2
12+
13+
- name: Setup node
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 16
17+
18+
- name: Cache packages
19+
uses: actions/cache@v3
20+
with:
21+
key: node_modules-v4-${{ hashFiles('yarn.lock') }}
22+
path: |-
23+
node_modules
24+
*/node_modules
25+
restore-keys: 'node_modules-v4-'
26+
27+
- name: Yarn install
28+
run: yarn install --ignore-optional --frozen-lockfile
29+
30+
- name: Lint
31+
run: yarn run lint
32+
33+
type-check:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Git Checkout
37+
uses: actions/checkout@v2
38+
39+
- name: Setup node
40+
uses: actions/setup-node@v3
41+
with:
42+
node-version: 16
43+
44+
- name: Cache packages
45+
uses: actions/cache@v3
46+
with:
47+
key: node_modules-v4-${{ hashFiles('yarn.lock') }}
48+
path: |-
49+
node_modules
50+
*/node_modules
51+
restore-keys: 'node_modules-v4-'
52+
53+
- name: Yarn install
54+
run: yarn install --ignore-optional --frozen-lockfile
55+
56+
- name: Type Check
57+
run: yarn run typescript
58+
759
test:
860
runs-on: ubuntu-latest
961
steps:

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"test:ci": "jest ./src --maxWorkers=2",
4343
"test:watch": "jest ./src --watch",
4444
"test:coverage": "jest ./src --coverage",
45+
"typescript": "tsc --noEmit",
4546
"lint": "eslint --ext .js,.ts,.tsx src",
4647
"lint:fix": "yarn run lint --fix",
4748
"semantic-release": "semantic-release",

src/Checkbox/Checkbox.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(
216216
setState(newState);
217217
onChange(e);
218218
},
219-
[onChange]
219+
[onChange, setState]
220220
);
221221

222222
const CheckboxComponent = CheckboxComponents[variant];

0 commit comments

Comments
 (0)