Skip to content

Commit

Permalink
build(frontend): Add tsc to lint (#9911)
Browse files Browse the repository at this point in the history
  • Loading branch information
asikowitz authored Feb 24, 2024
1 parent 3921588 commit c1332c6
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 7 deletions.
6 changes: 5 additions & 1 deletion datahub-web-react/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions datahub-web-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function EntityInfo({ formUrn }: Props) {
>
View Profile <LinkOut style={{ marginLeft: '4px' }} />
</StyledLink>
<DatasetStatsSummarySubHeader properties={{ shouldWrap: true }} />
<DatasetStatsSummarySubHeader />
<FormInfoWrapper>
<FormInfo shouldDisplayBackground formUrn={formUrn} />
</FormInfoWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default function FormByEntity({ formUrn }: Props) {
dataNotCombinedWithSiblings: selectedEntityData,
routeToTab: () => {},
refetch,
lineage: undefined,
}}
>
<ContentWrapper>
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -64,7 +64,7 @@ class DataHubMentionsExtension extends NodeExtension<DataHubMentionsOptions> {
});
}

createNodeSpec(extra: ApplySchemaAttributes, override: NodeSpecOverride): NodeExtensionSpec {
createNodeSpec(extra: ApplySchemaAttributes, override: Partial<NodeSpecOverride>): NodeExtensionSpec {
return {
inline: true,
marks: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const InputFieldsTab = () => {
<SchemaTable
schemaMetadata={null}
rows={rows}
editMode={false}
editableSchemaMetadata={null}
usageStats={null}
schemaFieldBlameList={null}
Expand Down
23 changes: 23 additions & 0 deletions datahub-web-react/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "es2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"noImplicitAny": false,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": false,
"noEmit": true,
"jsx": "react-jsx",
"types": ["vitest/globals"]
},
"include": ["src", "src/conf/theme/styled-components.d.ts", "vite.config.ts", ".eslintrc.js"],
"exclude": ["**/*.test.ts*"],
}

0 comments on commit c1332c6

Please sign in to comment.