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

* enable eslint rule for duplicate import statements

* updates lint warn to an error
This commit is contained in:
Devin W. Hurley 2019-09-13 09:15:42 -04:00 committed by GitHub
parent e4225a70d9
commit 8bc8ae2053
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-continue': 'error',
'no-dupe-keys': 'error', 'no-dupe-keys': 'error',
'no-duplicate-case': 'error', 'no-duplicate-case': 'error',
// This will be turned on after bug fixes are mostly completed 'no-duplicate-imports': 'error',
// 'no-duplicate-imports': 'warn',
'no-empty-character-class': 'error', 'no-empty-character-class': 'error',
'no-empty-pattern': 'error', 'no-empty-pattern': 'error',
'no-ex-assign': 'error', 'no-ex-assign': 'error',

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,10 +4,8 @@
* you may not use this file except in compliance with the Elastic License. * 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 React from 'react';
import { EuiLoadingSpinner } from '@elastic/eui';
import { EuiFlexItem } from '@elastic/eui';
import styled from 'styled-components'; import styled from 'styled-components';
import { KpiHostsData, KpiHostDetailsData } from '../../../../graphql/types'; import { KpiHostsData, KpiHostDetailsData } from '../../../../graphql/types';
import { StatItemsComponent, StatItemsProps, useKpiMatrixStatus } from '../../../stat_items'; 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. * you may not use this file except in compliance with the Elastic License.
*/ */
import { EuiFlexGroup } from '@elastic/eui';
import React from 'react'; import React from 'react';
import { EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; import { EuiFlexItem, EuiLoadingSpinner, EuiFlexGroup, EuiSpacer } from '@elastic/eui';
import styled from 'styled-components'; import styled from 'styled-components';
import { EuiSpacer } from '@elastic/eui';
import { chunk as _chunk } from 'lodash/fp'; import { chunk as _chunk } from 'lodash/fp';
import { import {
StatItemsComponent, StatItemsComponent,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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