From adc7892d8cae659b3f8bca212e377aba925fa537 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 6 May 2022 22:55:47 +0100 Subject: [PATCH] Enable type checking & disable lint warning --- .github/workflows/lint.yaml | 8 +++++--- package.json | 3 ++- src/Avatar.tsx | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index ef15558..60e6703 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,9 +1,9 @@ -name: Lint and format +name: Lint, format & type check on: pull_request: {} jobs: prettier: - name: Lint and format + name: Lint, format & type check runs-on: ubuntu-latest steps: - name: Checkout code @@ -17,4 +17,6 @@ jobs: - name: Prettier run: "yarn run prettier:check" - name: ESLint - run: "yarn run lint" + run: "yarn run lint:js" + - name: Type check + run: "yarn run lint:types" diff --git a/package.json b/package.json index 60ff79d..88cab6b 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "build-storybook": "build-storybook", "prettier:check": "prettier -c src", "prettier:format": "prettier -w src", - "lint": "eslint --max-warnings 2 src" + "lint:js": "eslint --max-warnings 2 src", + "lint:types": "tsc" }, "dependencies": { "@juggle/resize-observer": "^3.3.1", diff --git a/src/Avatar.tsx b/src/Avatar.tsx index c2fd11b..eda272a 100644 --- a/src/Avatar.tsx +++ b/src/Avatar.tsx @@ -50,6 +50,7 @@ export const Avatar: React.FC = ({ return backgroundColors[index]; }, [bgKey, src, fallback]); + /* eslint-disable jsx-a11y/alt-text */ return (