From fa315bf3f2c195dddaad65aab329863747effd8c Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sat, 26 Sep 2020 18:57:07 +0200 Subject: [PATCH 1/2] [test] Add missing types linting for x-grid --- packages/grid/x-grid/package.json | 11 ++++++----- packages/grid/x-grid/src/XGrid.test.tsx | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/grid/x-grid/package.json b/packages/grid/x-grid/package.json index 797b63591ca05..f7938a8053b59 100644 --- a/packages/grid/x-grid/package.json +++ b/packages/grid/x-grid/package.json @@ -24,6 +24,12 @@ "datagrid", "data-grid" ], + "scripts": { + "precommit": "npm run lint", + "lint": "../../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../../.eslintrc.js && npm run lint:css", + "lint:css": "stylelint 'src/**/*.{ts,tsx}' ../../../.stylelintrc.js", + "typescript": "tsc -p tsconfig.json" + }, "dependencies": { "@material-ui/x-license": "^4.0.0-alpha.6", "prop-types": "^15.7.2", @@ -34,11 +40,6 @@ "@material-ui/core": "^4.9.12", "react": "^16.8.0" }, - "scripts": { - "precommit": "npm run lint", - "lint": "../../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../../.eslintrc.js && npm run lint:css", - "lint:css": "stylelint 'src/**/*.{ts,tsx}' ../../../.stylelintrc.js" - }, "setupFiles": [ "/src/setupTests.js" ], diff --git a/packages/grid/x-grid/src/XGrid.test.tsx b/packages/grid/x-grid/src/XGrid.test.tsx index 79d7aa118e6bc..b9f4db9a68df1 100644 --- a/packages/grid/x-grid/src/XGrid.test.tsx +++ b/packages/grid/x-grid/src/XGrid.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +// @ts-ignore import { screen, createClientRender, act, fireEvent } from 'test/utils'; import { expect } from 'chai'; import { XGrid, useApiRef } from '@material-ui/x-grid'; @@ -74,7 +75,7 @@ describe('', () => { // Adapation of describeConformance() describe('Material-UI component API', () => { it(`attaches the ref`, () => { - const ref = React.createRef(); + const ref = React.createRef(); const { container } = render(
From 2d1b29c1fae21826fc804267e5341036003b3445 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Mon, 28 Sep 2020 16:41:50 +0200 Subject: [PATCH 2/2] get fail once migrated to TypeScript --- packages/grid/data-grid/src/DataGrid.test.tsx | 2 +- packages/grid/x-grid/src/XGrid.test.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grid/data-grid/src/DataGrid.test.tsx b/packages/grid/data-grid/src/DataGrid.test.tsx index 2844d6bc85776..6310b11dbf997 100644 --- a/packages/grid/data-grid/src/DataGrid.test.tsx +++ b/packages/grid/data-grid/src/DataGrid.test.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/forbid-foreign-prop-types */ import * as React from 'react'; import PropTypes from 'prop-types'; -// @ts-ignore +// @ts-expect-error need to migrate helpers to TypeScript import { createClientRender, ErrorBoundary } from 'test/utils'; import { expect } from 'chai'; import { DataGrid } from '@material-ui/data-grid'; diff --git a/packages/grid/x-grid/src/XGrid.test.tsx b/packages/grid/x-grid/src/XGrid.test.tsx index b9f4db9a68df1..cb77a32cf08c4 100644 --- a/packages/grid/x-grid/src/XGrid.test.tsx +++ b/packages/grid/x-grid/src/XGrid.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -// @ts-ignore +// @ts-expect-error need to migrate helpers to TypeScript import { screen, createClientRender, act, fireEvent } from 'test/utils'; import { expect } from 'chai'; import { XGrid, useApiRef } from '@material-ui/x-grid';