From c1332c65fa5f3db2d9549496ede1976035dfbf4f Mon Sep 17 00:00:00 2001 From: Andrew Sikowitz Date: Fri, 23 Feb 2024 20:18:43 -0500 Subject: [PATCH] build(frontend): Add tsc to lint (#9911) --- datahub-web-react/build.gradle | 6 ++++- datahub-web-react/package.json | 6 +++-- .../profile/sidebar/EntityInfo/EntityInfo.tsx | 2 +- .../entity/shared/entityForm/FormByEntity.tsx | 1 + .../mentions/DataHubMentionsExtension.tsx | 4 ++-- .../shared/tabs/Entity/InputFieldsTab.tsx | 1 - datahub-web-react/tsconfig.test.json | 23 +++++++++++++++++++ 7 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 datahub-web-react/tsconfig.test.json diff --git a/datahub-web-react/build.gradle b/datahub-web-react/build.gradle index 05af6871715ced..103792b20f761d 100644 --- a/datahub-web-react/build.gradle +++ b/datahub-web-react/build.gradle @@ -112,13 +112,17 @@ task yarnBuild(type: YarnTask, dependsOn: [yarnInstall, yarnGenerate]) { outputs.dir('dist') } +task cleanGenerate { + delete fileTree(dir: 'src', include: '**/*.generated.ts') +} + task cleanExtraDirs { delete 'node_modules/.yarn-integrity' delete 'dist' delete 'tmp' delete 'just' - delete fileTree(dir: 'src', include: '*.generated.ts') } +cleanExtraDirs.finalizedBy(cleanGenerate) clean.finalizedBy(cleanExtraDirs) configurations { diff --git a/datahub-web-react/package.json b/datahub-web-react/package.json index 337b0dc87ec1c1..230dcad45468e1 100644 --- a/datahub-web-react/package.json +++ b/datahub-web-react/package.json @@ -88,8 +88,10 @@ "build": "yarn run generate && NODE_OPTIONS='--max-old-space-size=3072 --openssl-legacy-provider' CI=false vite build", "test": "vitest", "generate": "graphql-codegen --config codegen.yml", - "lint": "eslint . --ext .ts,.tsx --quiet", - "lint-fix": "eslint '*/**/*.{ts,tsx}' --quiet --fix" + "lint": "eslint . --ext .ts,.tsx --quiet && yarn type-check", + "lint-fix": "eslint '*/**/*.{ts,tsx}' --quiet --fix", + "type-check": "tsc --noEmit -p tsconfig.test.json", + "type-watch": "tsc -w --noEmit -p tsconfig.test.json" }, "browserslist": { "production": [ diff --git a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/EntityInfo/EntityInfo.tsx b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/EntityInfo/EntityInfo.tsx index 1d1400a8cc7539..02dc70dc157bde 100644 --- a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/EntityInfo/EntityInfo.tsx +++ b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/EntityInfo/EntityInfo.tsx @@ -56,7 +56,7 @@ export default function EntityInfo({ formUrn }: Props) { > View Profile - + diff --git a/datahub-web-react/src/app/entity/shared/entityForm/FormByEntity.tsx b/datahub-web-react/src/app/entity/shared/entityForm/FormByEntity.tsx index 6fe03585e6405d..b20aa26930fe92 100644 --- a/datahub-web-react/src/app/entity/shared/entityForm/FormByEntity.tsx +++ b/datahub-web-react/src/app/entity/shared/entityForm/FormByEntity.tsx @@ -46,6 +46,7 @@ export default function FormByEntity({ formUrn }: Props) { dataNotCombinedWithSiblings: selectedEntityData, routeToTab: () => {}, refetch, + lineage: undefined, }} > diff --git a/datahub-web-react/src/app/entity/shared/tabs/Documentation/components/editor/extensions/mentions/DataHubMentionsExtension.tsx b/datahub-web-react/src/app/entity/shared/tabs/Documentation/components/editor/extensions/mentions/DataHubMentionsExtension.tsx index d4c6ace1897062..ed7881b340c437 100644 --- a/datahub-web-react/src/app/entity/shared/tabs/Documentation/components/editor/extensions/mentions/DataHubMentionsExtension.tsx +++ b/datahub-web-react/src/app/entity/shared/tabs/Documentation/components/editor/extensions/mentions/DataHubMentionsExtension.tsx @@ -1,6 +1,6 @@ /* eslint-disable class-methods-use-this */ import React, { ComponentType } from 'react'; -import { Plugin } from '@remirror/pm/state'; +import type { Plugin } from 'prosemirror-state'; import { ApplySchemaAttributes, CommandFunction, @@ -64,7 +64,7 @@ class DataHubMentionsExtension extends NodeExtension { }); } - createNodeSpec(extra: ApplySchemaAttributes, override: NodeSpecOverride): NodeExtensionSpec { + createNodeSpec(extra: ApplySchemaAttributes, override: Partial): NodeExtensionSpec { return { inline: true, marks: '', diff --git a/datahub-web-react/src/app/entity/shared/tabs/Entity/InputFieldsTab.tsx b/datahub-web-react/src/app/entity/shared/tabs/Entity/InputFieldsTab.tsx index b9d06afabb097b..cee65793a80e46 100644 --- a/datahub-web-react/src/app/entity/shared/tabs/Entity/InputFieldsTab.tsx +++ b/datahub-web-react/src/app/entity/shared/tabs/Entity/InputFieldsTab.tsx @@ -35,7 +35,6 @@ export const InputFieldsTab = () => {