diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0018d39 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: '18' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Type checking + run: npm run typecheck + + - name: Linting + run: npm run lint:fix diff --git a/.husky/pre-commit b/.husky/pre-commit index ec23fb2..0182f87 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -yarn run typecheck && yarn run lint --fix +npm run typecheck && npm run lint:fix diff --git a/package.json b/package.json index 7880a37..273a1b5 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "scripts": { "build": "next build", "dev": "next dev", - "lint": "eslint --ext js,jsx,ts,tsx .", - "lint:fix": "eslint --ext js,jsx,ts,tsx --fix .", + "lint": "eslint --ext js,jsx,ts,tsx --max-warnings=0 .", + "lint:fix": "eslint --ext js,jsx,ts,tsx --max-warnings=0 --fix .", "lint:package": "sort-package-json", "typecheck": "tsc --pretty" },