From: David Cho-Lerat Date: Mon, 13 Mar 2023 12:24:38 +0000 (+0100) Subject: Add "ts-check" script for `design-system/` X-Git-Tag: 10.0.0.68432~154 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=36a0ecb1477f28238db28ba44e9e9edf8ab48c78;p=sonarqube.git Add "ts-check" script for `design-system/` --- diff --git a/server/sonar-web/design-system/package.json b/server/sonar-web/design-system/package.json index ff2d3f8d877..e4f4d91ea32 100644 --- a/server/sonar-web/design-system/package.json +++ b/server/sonar-web/design-system/package.json @@ -4,12 +4,13 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { - "build": "yarn lint && vite build", + "build": "yarn lint && yarn ts-check && vite build", "build-release": "yarn install --immutable && yarn build", "lint": "eslint --ext js,ts,tsx,snap --quiet src", "lint-report-ci": "yarn install --immutable && eslint --ext js,ts,tsx -f json -o eslint-report/eslint-report.json src || yarn lint", "test": "jest", - "validate-ci": "yarn install --immutable && yarn test --coverage --ci" + "ts-check": "tsc --noEmit", + "validate-ci": "yarn install --immutable && yarn ts-check && yarn test --coverage --ci" }, "devDependencies": { "@babel/core": "7.20.5", diff --git a/server/sonar-web/design-system/src/components/__tests__/DeferredSpinner-test.tsx b/server/sonar-web/design-system/src/components/__tests__/DeferredSpinner-test.tsx index d6b7c43d467..3893a349555 100644 --- a/server/sonar-web/design-system/src/components/__tests__/DeferredSpinner-test.tsx +++ b/server/sonar-web/design-system/src/components/__tests__/DeferredSpinner-test.tsx @@ -18,7 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { render, screen } from '@testing-library/react'; -import * as React from 'react'; +// @ts-expect-error React is needed for <> fragments +import React from 'react'; import DeferredSpinner from '../DeferredSpinner'; beforeAll(() => { diff --git a/server/sonar-web/design-system/src/components/__tests__/Link-test.tsx b/server/sonar-web/design-system/src/components/__tests__/Link-test.tsx index 295469720f0..fde843342b2 100644 --- a/server/sonar-web/design-system/src/components/__tests__/Link-test.tsx +++ b/server/sonar-web/design-system/src/components/__tests__/Link-test.tsx @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { screen } from '@testing-library/react'; +// @ts-expect-error React is needed for <> fragments import React from 'react'; import { MemoryRouter, Route, Routes, useLocation } from 'react-router-dom'; import { render } from '../../helpers/testUtils'; diff --git a/server/sonar-web/design-system/src/components/__tests__/NavLink-test.tsx b/server/sonar-web/design-system/src/components/__tests__/NavLink-test.tsx index 548cfb6c238..45f967d930b 100644 --- a/server/sonar-web/design-system/src/components/__tests__/NavLink-test.tsx +++ b/server/sonar-web/design-system/src/components/__tests__/NavLink-test.tsx @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { screen } from '@testing-library/react'; +// @ts-expect-error React is needed for <> fragments import React from 'react'; import { MemoryRouter, Route, Routes, useLocation } from 'react-router-dom'; import { render } from '../../helpers/testUtils';