Skip to content

Commit

Permalink
[test] Add missing types linting for x-grid (mui#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored and dtassone committed Nov 9, 2020
1 parent cbd62d9 commit b059063
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/grid/data-grid/src/DataGrid.test.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
11 changes: 6 additions & 5 deletions packages/grid/x-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": [
"<rootDir>/src/setupTests.js"
],
Expand Down
3 changes: 2 additions & 1 deletion packages/grid/x-grid/src/XGrid.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
// @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';
Expand Down Expand Up @@ -74,7 +75,7 @@ describe('<XGrid />', () => {
// Adapation of describeConformance()
describe('Material-UI component API', () => {
it(`attaches the ref`, () => {
const ref = React.createRef();
const ref = React.createRef<HTMLDivElement>();
const { container } = render(
<div style={{ width: 300, height: 300 }}>
<XGrid {...defaultProps} ref={ref} />
Expand Down

0 comments on commit b059063

Please sign in to comment.