Skip to content

Commit

Permalink
solves simplest ts-ignore cases
Browse files Browse the repository at this point in the history
some simply just needed to be removed (mostly due to ignores for files that didn't used to have types but now do)
  • Loading branch information
dimitropoulos committed Jun 10, 2020
1 parent d0f9f2b commit 98ea46b
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 21 deletions.
3 changes: 1 addition & 2 deletions src/components/bottom_bar/bottom_bar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ import { keysOf } from '../common';

import { EuiBottomBar, paddingSizeToClassNameMap } from './bottom_bar';

// TODO: Temporary hack which we can remove once react-test-renderer supports portals.
// @ts-ignore TODO: Temporary hack which we can remove once react-test-renderer supports portals.
// More info at https://github.com/facebook/react/issues/11565.
// @ts-ignore TODO: Needs Description
ReactDOM.createPortal = node => node;

describe('EuiBottomBar', () => {
Expand Down
6 changes: 2 additions & 4 deletions src/components/color_picker/color_stops/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@ describe('isInvalid', () => {

test('Should mark colorStops missing stop as invalid', () => {
const colorStops = [{ stop: null, color: '#FF0000' }];
// Intentionally wrong
// @ts-ignore TODO: Needs Description
// @ts-ignore Intentionally wrong
expect(isInvalid(colorStops)).toBe(true);
});

test('Should mark colorStops with invalid stop as invalid', () => {
const colorStops = [{ stop: 'I am not a number', color: '#FF0000' }];
// Intentionally wrong
// @ts-ignore TODO: Needs Description
// @ts-ignore Intentionally wrong
expect(isInvalid(colorStops)).toBe(true);
});
});
Expand Down
1 change: 0 additions & 1 deletion src/components/datagrid/data_grid_body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

import React, { Fragment, FunctionComponent, useMemo } from 'react';
// @ts-ignore TODO: Needs Description
import { EuiCodeBlock } from '../code';
import {
EuiDataGridControlColumn,
Expand Down
4 changes: 2 additions & 2 deletions src/components/datagrid/data_grid_inmemory_renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ function noop() {}
function getElementText(element: HTMLElement) {
return 'innerText' in element
? element.innerText
: // TS thinks element.innerText always exists, however it doesn't in jest/jsdom enviornment
// @ts-ignore TODO: Needs Description
: // (this line left here to satisfy Prettier since a ts-ignore is used on the next line)
// @ts-ignore TypeScript thinks element.innerText always exists, however it doesn't in jest/jsdom enviornment
element.textContent || undefined;
}

Expand Down
2 changes: 0 additions & 2 deletions src/components/datagrid/style_selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
import React, { ReactElement, useState } from 'react';
import { EuiDataGridStyle } from './data_grid_types';
import { EuiI18n } from '../i18n';
// @ts-ignore TODO: Needs Description
import { EuiPopover } from '../popover';
// @ts-ignore TODO: Needs Description
import { EuiButtonEmpty, EuiButtonGroup } from '../button';

export const startingStyles: EuiDataGridStyle = {
Expand Down
3 changes: 1 addition & 2 deletions src/components/flex/flex_group.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ describe('EuiFlexGroup', () => {
test(`${value} is not rendered`, () => {
expect(() =>
render(
// intentionally passing an invalid value
// @ts-ignore TODO: Needs Description
// @ts-ignore intentionally passing an invalid value
<EuiFlexGroup component={value} />
)
).toThrow();
Expand Down
7 changes: 2 additions & 5 deletions src/components/i18n/i18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@ function lookupToken<
if (typeof renderable === 'function') {
if (values === undefined) {
return errorOnMissingValues(token);
} else {
// @ts-ignore TODO: Needs Description
// TypeScript complains that `DEFAULT` doesn't have a call signature
// but we verified `renderable` is a function
return renderable(values);
}
// @ts-ignore TypeScript complains that `DEFAULT` doesn't have a call signature but we verified `renderable` is a function
return renderable(values);
} else if (values === undefined || typeof renderable !== 'string') {
if (i18nMappingFunc && typeof valueDefault === 'string') {
renderable = i18nMappingFunc(valueDefault);
Expand Down
3 changes: 1 addition & 2 deletions src/components/icon/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import classNames from 'classnames';

import { CommonProps, keysOf } from '../common';

// @ts-ignore TODO: Needs Description
// not generating typescript files or definitions for the generated JS components
// @ts-ignore not generating typescript files or definitions for the generated JS components
// because we'd need to dynamically know if we're importing the
// TS file (dev/docs) or the JS file (distributed), and it's more effort than worth
// to generate & git track a TS module definition for each icon component
Expand Down
1 change: 0 additions & 1 deletion src/components/suggest/suggest_input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import React, { useState, FunctionComponent } from 'react';
import { CommonProps } from '../common';
import classNames from 'classnames';
// @ts-ignore TODO: Needs Description
import { EuiFieldText } from '../form';
import { EuiToolTip } from '../tool_tip';
import { EuiIcon } from '../icon';
Expand Down

0 comments on commit 98ea46b

Please sign in to comment.