Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint: Remove ts-ignore comments #10933

Merged
merged 11 commits into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 103 additions & 35 deletions superset-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@
"dom-to-image": "^2.6.0",
"geolib": "^2.0.24",
"global-box": "^1.2.0",
"immutable": "^3.8.2",
"immutable": "^4.0.0-rc.12",
"interweave": "^11.2.0",
"jquery": "^3.5.1",
"json-bigint": "^0.3.0",
"json-bigint": "^1.0.0",
"lodash": "^4.17.20",
"lodash-es": "^4.17.14",
"mathjs": "^3.20.2",
Expand All @@ -127,7 +127,7 @@
"react-ace": "^5.10.0",
"react-avatar": "^3.9.7",
"react-bootstrap": "^0.33.1",
"react-bootstrap-dialog": "^0.10.0",
"react-bootstrap-dialog": "^0.13.0",
"react-bootstrap-slider": "2.1.5",
"react-checkbox-tree": "^1.5.1",
"react-color": "^2.13.8",
Expand All @@ -150,7 +150,7 @@
"react-sortable-hoc": "^1.11.0",
"react-split": "^2.0.4",
"react-sticky": "^6.0.2",
"react-syntax-highlighter": "^7.0.4",
"react-syntax-highlighter": "^13.5.3",
"react-table": "^7.2.1",
"react-transition-group": "^2.5.3",
"react-ultimate-pagination": "^1.2.0",
Expand Down Expand Up @@ -200,6 +200,7 @@
"@types/fetch-mock": "^7.3.2",
"@types/jest": "^26.0.3",
"@types/jquery": "^3.3.32",
"@types/json-bigint": "^1.0.0",
"@types/react": "^16.9.43",
"@types/react-bootstrap": "^0.32.22",
"@types/react-dom": "^16.9.8",
Expand Down
10 changes: 4 additions & 6 deletions superset-frontend/src/SqlLab/components/HighlightedSql.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@
*/
import React from 'react';
import PropTypes from 'prop-types';
import SyntaxHighlighter, {
registerLanguage,
} from 'react-syntax-highlighter/dist/light';
import sql from 'react-syntax-highlighter/dist/languages/hljs/sql';
import github from 'react-syntax-highlighter/dist/styles/hljs/github';
import SyntaxHighlighter from 'react-syntax-highlighter/dist/cjs/light';
import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql';
import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github';
import { t } from '@superset-ui/core';

import ModalTrigger from '../../components/ModalTrigger';

registerLanguage('sql', sql);
SyntaxHighlighter.registerLanguage('sql', sql);

const defaultProps = {
maxWidth: 50,
Expand Down
17 changes: 13 additions & 4 deletions superset-frontend/src/SqlLab/components/LimitControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@
* under the License.
*/
import React from 'react';
import { FormGroup, FormControl, Overlay, Popover } from 'react-bootstrap';
import {
FormGroup,
FormControl,
Overlay,
Popover,
FormControlProps,
} from 'react-bootstrap';
import Button from 'src/components/Button';
import { t, styled } from '@superset-ui/core';

Expand Down Expand Up @@ -105,9 +111,12 @@ export default class LimitControl extends React.PureComponent<
value={textValue}
placeholder={t(`Max: ${this.props.maxRow}`)}
bsSize="small"
// @ts-ignore
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
this.setState({ textValue: event.target.value })
onChange={(
event: React.FormEvent<FormControl & FormControlProps>,
) =>
this.setState({
textValue: (event.currentTarget?.value as string) ?? '',
})
}
/>
</FormGroup>
Expand Down
13 changes: 4 additions & 9 deletions superset-frontend/src/SqlLab/components/ShowSQL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,14 @@
* under the License.
*/
import React from 'react';
import SyntaxHighlighter, {
registerLanguage,
// @ts-ignore
} from 'react-syntax-highlighter/dist/light';
// @ts-ignore
import sql from 'react-syntax-highlighter/dist/languages/hljs/sql';
// @ts-ignore
import github from 'react-syntax-highlighter/dist/styles/hljs/github';
import SyntaxHighlighter from 'react-syntax-highlighter/dist/cjs/light';
import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql';
import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github';

import Link from '../../components/Link';
import ModalTrigger from '../../components/ModalTrigger';

registerLanguage('sql', sql);
SyntaxHighlighter.registerLanguage('sql', sql);

interface ShowSQLProps {
sql: string;
Expand Down
12 changes: 7 additions & 5 deletions superset-frontend/src/components/DeleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import { t, styled } from '@superset-ui/core';
import React, { useState } from 'react';
import { FormGroup, FormControl } from 'react-bootstrap';
import { FormGroup, FormControl, FormControlProps } from 'react-bootstrap';
import Modal from 'src/components/Modal';
import FormLabel from 'src/components/FormLabel';

Expand Down Expand Up @@ -70,10 +70,12 @@ export default function DeleteModal({
id="delete"
type="text"
bsSize="sm"
// @ts-ignore
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
setDisableChange(event.target.value.toUpperCase() !== 'DELETE')
}
onChange={(
event: React.FormEvent<FormControl & FormControlProps>,
) => {
const targetValue = (event.currentTarget?.value as string) ?? '';
setDisableChange(targetValue.toUpperCase() !== 'DELETE');
}}
/>
</StyleFormGroup>
</Modal>
Expand Down
Loading