Skip to content

Commit

Permalink
ci: add lint and type checking
Browse files Browse the repository at this point in the history
This also fixes some remaining lint issues.
  • Loading branch information
WesSouza authored and arturbien committed Aug 4, 2022
1 parent 5abcb3e commit 71a964e
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,58 @@ on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Cache packages
uses: actions/cache@v3
with:
key: node_modules-v4-${{ hashFiles('yarn.lock') }}
path: |-
node_modules
*/node_modules
restore-keys: 'node_modules-v4-'

- name: Yarn install
run: yarn install --ignore-optional --frozen-lockfile

- name: Lint
run: yarn run lint

type-check:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Cache packages
uses: actions/cache@v3
with:
key: node_modules-v4-${{ hashFiles('yarn.lock') }}
path: |-
node_modules
*/node_modules
restore-keys: 'node_modules-v4-'

- name: Yarn install
run: yarn install --ignore-optional --frozen-lockfile

- name: Type Check
run: yarn run typescript

test:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"test:ci": "jest ./src --maxWorkers=2",
"test:watch": "jest ./src --watch",
"test:coverage": "jest ./src --coverage",
"typescript": "tsc --noEmit",
"lint": "eslint --ext .js,.ts,.tsx src",
"lint:fix": "yarn run lint --fix",
"semantic-release": "semantic-release",
Expand Down
2 changes: 1 addition & 1 deletion src/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(
setState(newState);
onChange(e);
},
[onChange]
[onChange, setState]
);

const CheckboxComponent = CheckboxComponents[variant];
Expand Down

0 comments on commit 71a964e

Please sign in to comment.