[SIEM] Enable eslint rule for duplicate import statements (#45552) (#45635)

* enable eslint rule for duplicate import statements

* updates lint warn to an error
This commit is contained in:
Devin W. Hurley 2019-09-13 12:28:16 -04:00 committed by GitHub
parent a23213795b
commit 95ed8e1d4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 26 additions and 36 deletions

View file

@ -537,8 +537,7 @@ module.exports = {
'no-continue': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
// This will be turned on after bug fixes are mostly completed
// 'no-duplicate-imports': 'warn',
'no-duplicate-imports': 'error',
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',

View file

@ -6,8 +6,16 @@
import React from 'react';
import { Chart, BarSeries, Axis, Position, getSpecId, ScaleType, Settings } from '@elastic/charts';
import { getAxisId } from '@elastic/charts';
import {
Chart,
BarSeries,
Axis,
Position,
getAxisId,
getSpecId,
ScaleType,
Settings,
} from '@elastic/charts';
import { getOr, get } from 'lodash/fp';
import {
ChartConfigsData,

View file

@ -5,8 +5,7 @@
*/
import { EuiFlexGroup, EuiSpacer } from '@elastic/eui';
import * as React from 'react';
import { useEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';
import { npStart } from 'ui/new_platform';
import { SavedObjectFinder } from 'ui/saved_objects/components/saved_object_finder';

View file

@ -13,10 +13,9 @@ import {
EuiText,
EuiToolTip,
} from '@elastic/eui';
import * as React from 'react';
import React, { useContext } from 'react';
import styled from 'styled-components';
import { useContext } from 'react';
import { BrowserFields } from '../../containers/source';
import { getColumnsWithTimestamp } from '../event_details/helpers';
import { OnUpdateColumns } from '../timeline/events';

View file

@ -15,10 +15,9 @@ import {
EuiText,
EuiToolTip,
} from '@elastic/eui';
import * as React from 'react';
import React, { useContext } from 'react';
import styled, { css } from 'styled-components';
import { useContext } from 'react';
import { WithCopyToClipboard } from '../../lib/clipboard/with_copy_to_clipboard';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { OnUpdateColumns } from '../timeline/events';

View file

@ -18,8 +18,7 @@ import {
} from '../certificate_fingerprint';
import { EVENT_DURATION_FIELD_NAME } from '../duration';
import { ID_FIELD_NAME } from '../event_details/event_id';
import { DESTINATION_IP_FIELD_NAME } from '../ip';
import { SOURCE_IP_FIELD_NAME } from '../ip';
import { DESTINATION_IP_FIELD_NAME, SOURCE_IP_FIELD_NAME } from '../ip';
import { JA3_HASH_FIELD_NAME } from '../ja3_fingerprint';
import { DESTINATION_PORT_FIELD_NAME, SOURCE_PORT_FIELD_NAME } from '../port';
import {

View file

@ -11,10 +11,10 @@ import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { defaultHeaders } from '../../components/timeline/body/column_headers/default_headers';
import { deleteTimelineMutation } from '../../containers/timeline/delete/persist.gql_query';
import { AllTimelinesVariables } from '../../containers/timeline/all';
import { AllTimelinesVariables, AllTimelinesQuery } from '../../containers/timeline/all';
import { allTimelinesQuery } from '../../containers/timeline/all/index.gql_query';
import { DeleteTimelineMutation, SortFieldTimeline } from '../../graphql/types';
import { DeleteTimelineMutation, SortFieldTimeline, Direction } from '../../graphql/types';
import { State, timelineSelectors } from '../../store';
import {
createTimeline as dispatchCreateNewTimeline,
@ -40,8 +40,6 @@ import {
OpenTimelineDispatchProps,
OpenTimelineReduxProps,
} from './types';
import { AllTimelinesQuery } from '../../containers/timeline/all';
import { Direction } from '../../graphql/types';
import { DEFAULT_SORT_FIELD, DEFAULT_SORT_DIRECTION } from './constants';
export interface OpenTimelineState {

View file

@ -4,10 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { EuiFlexGroup } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui';
import React from 'react';
import { EuiLoadingSpinner } from '@elastic/eui';
import { EuiFlexItem } from '@elastic/eui';
import styled from 'styled-components';
import { KpiHostsData, KpiHostDetailsData } from '../../../../graphql/types';
import { StatItemsComponent, StatItemsProps, useKpiMatrixStatus } from '../../../stat_items';

View file

@ -4,12 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { EuiFlexGroup } from '@elastic/eui';
import React from 'react';
import { EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui';
import { EuiFlexItem, EuiLoadingSpinner, EuiFlexGroup, EuiSpacer } from '@elastic/eui';
import styled from 'styled-components';
import { EuiSpacer } from '@elastic/eui';
import { chunk as _chunk } from 'lodash/fp';
import {
StatItemsComponent,

View file

@ -5,8 +5,7 @@
*/
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { get } from 'lodash/fp';
import { uniq } from 'lodash/fp';
import { get, uniq } from 'lodash/fp';
import * as React from 'react';
import { pure } from 'recompose';
import styled from 'styled-components';

View file

@ -14,8 +14,7 @@ import { asArrayIfExists } from '../../lib/helpers';
import { getMockNetflowData } from '../../mock';
import { TestProviders } from '../../mock/test_providers';
import { ID_FIELD_NAME } from '../event_details/event_id';
import { DESTINATION_IP_FIELD_NAME } from '../ip';
import { SOURCE_IP_FIELD_NAME } from '../ip';
import { DESTINATION_IP_FIELD_NAME, SOURCE_IP_FIELD_NAME } from '../ip';
import { DESTINATION_PORT_FIELD_NAME, SOURCE_PORT_FIELD_NAME } from '../port';
import {
DESTINATION_BYTES_FIELD_NAME,

View file

@ -4,8 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { EuiFlexGroup } from '@elastic/eui';
import { EuiSpacer } from '@elastic/eui';
import { EuiFlexGroup, EuiSpacer } from '@elastic/eui';
import { get } from 'lodash/fp';
import * as React from 'react';
import { pure } from 'recompose';

View file

@ -4,9 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { EuiFlexGroup } from '@elastic/eui';
import { EuiSpacer } from '@elastic/eui';
import { IconType } from '@elastic/eui';
import { EuiFlexGroup, EuiSpacer, IconType } from '@elastic/eui';
import { get } from 'lodash/fp';
import * as React from 'react';
import { pure } from 'recompose';

View file

@ -11,8 +11,7 @@ import { ActionCreator } from 'typescript-fsa';
import { StaticIndexPattern } from 'ui/index_patterns';
import { convertKueryToElasticSearchQuery } from '../../../lib/keury';
import { KueryFilterQuery, SerializedFilterQuery, timelineSelectors } from '../../../store';
import { State } from '../../../store';
import { KueryFilterQuery, SerializedFilterQuery, State, timelineSelectors } from '../../../store';
import { SearchOrFilter } from './search_or_filter';
import { timelineActions } from '../../../store/actions';

View file

@ -12,8 +12,7 @@ import { MockedProvider } from 'react-apollo/test-utils';
import { eventsQuery } from '../../containers/events/index.gql_query';
import { mockBrowserFields } from '../../containers/source/mock';
import { Direction } from '../../graphql/types';
import { defaultHeaders, mockTimelineData } from '../../mock';
import { mockIndexPattern } from '../../mock';
import { defaultHeaders, mockTimelineData, mockIndexPattern } from '../../mock';
import { TestProviders } from '../../mock/test_providers';
import { flyoutHeaderHeight } from '../flyout';

View file

@ -23,9 +23,9 @@ import {
mockGetHostLastFirstSeenResponse,
mockGetHostOverviewRequestDsl,
mockGetHostLastFirstSeenDsl,
mockGetHostsQueryDsl,
} from './mock';
import { HostAggEsItem } from './types';
import { mockGetHostsQueryDsl } from './mock';
jest.mock('./query.hosts.dsl', () => {
return {