From 409691d466dd58b50e03259a47278bf0df5614be Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Thu, 4 Apr 2024 17:07:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8(app-desk)=20improve=20linter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The linter was passing near the ts errors in the tests, we improve the linter by adding a ts checkup. --- src/frontend/apps/impress/.gitignore | 1 - src/frontend/apps/impress/.prettierignore | 1 + src/frontend/apps/impress/next-env.d.ts | 5 +++++ src/frontend/apps/impress/package.json | 2 +- .../apps/impress/src/api/__tests__/fetchApi.test.tsx | 2 +- 5 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 src/frontend/apps/impress/.prettierignore create mode 100644 src/frontend/apps/impress/next-env.d.ts diff --git a/src/frontend/apps/impress/.gitignore b/src/frontend/apps/impress/.gitignore index fd3dbb57..bad92b65 100644 --- a/src/frontend/apps/impress/.gitignore +++ b/src/frontend/apps/impress/.gitignore @@ -33,4 +33,3 @@ yarn-error.log* # typescript *.tsbuildinfo -next-env.d.ts diff --git a/src/frontend/apps/impress/.prettierignore b/src/frontend/apps/impress/.prettierignore new file mode 100644 index 00000000..f76c765b --- /dev/null +++ b/src/frontend/apps/impress/.prettierignore @@ -0,0 +1 @@ +next-env.d.ts diff --git a/src/frontend/apps/impress/next-env.d.ts b/src/frontend/apps/impress/next-env.d.ts new file mode 100644 index 00000000..62b8a52d --- /dev/null +++ b/src/frontend/apps/impress/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/src/frontend/apps/impress/package.json b/src/frontend/apps/impress/package.json index 8443083c..a8d9eb9d 100644 --- a/src/frontend/apps/impress/package.json +++ b/src/frontend/apps/impress/package.json @@ -8,7 +8,7 @@ "build:ci": "cp .env.development .env.local && yarn build", "build-theme": "cunningham -g css,ts -o src/cunningham --utility-classes", "start": "npx -y serve@latest out", - "lint": "next lint", + "lint": "tsc --noEmit && next lint", "prettier": "prettier --write .", "stylelint": "stylelint \"**/*.css\"", "test": "jest", diff --git a/src/frontend/apps/impress/src/api/__tests__/fetchApi.test.tsx b/src/frontend/apps/impress/src/api/__tests__/fetchApi.test.tsx index 72077d6e..d08d86d1 100644 --- a/src/frontend/apps/impress/src/api/__tests__/fetchApi.test.tsx +++ b/src/frontend/apps/impress/src/api/__tests__/fetchApi.test.tsx @@ -43,7 +43,7 @@ describe('fetchAPI', () => { }, }); - useAuthStore.setState({ userData: { email: 'test@test.com' } }); + useAuthStore.setState({ userData: { email: 'test@test.com', id: '1234' } }); fetchMock.mock('http://some.api.url/api/v1.0/some/url', 401);