mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* update deps * update rules use type-aware @typescript-eslint/no-shadow instead of no-shadow. do not use no-undef, rely on TypeScript instead * fix or mute all lint errors * react-hooks eslint plugin fails on ? syntax * fix wrong typings in viz * remove React as a global type * fix eslint errors * update version to 4.8.1 * fix a new error
This commit is contained in:
parent
dd3ea9c5d0
commit
90f76994d2
74 changed files with 152 additions and 155 deletions
|
@ -867,7 +867,8 @@ module.exports = {
|
|||
'no-shadow-restricted-names': 'error',
|
||||
'no-sparse-arrays': 'error',
|
||||
'no-this-before-super': 'error',
|
||||
'no-undef': 'error',
|
||||
// rely on typescript
|
||||
'no-undef': 'off',
|
||||
'no-unreachable': 'error',
|
||||
'no-unsafe-finally': 'error',
|
||||
'no-useless-call': 'error',
|
||||
|
@ -1002,7 +1003,8 @@ module.exports = {
|
|||
'no-shadow-restricted-names': 'error',
|
||||
'no-sparse-arrays': 'error',
|
||||
'no-this-before-super': 'error',
|
||||
'no-undef': 'error',
|
||||
// rely on typescript
|
||||
'no-undef': 'off',
|
||||
'no-unreachable': 'error',
|
||||
'no-unsafe-finally': 'error',
|
||||
'no-useless-call': 'error',
|
||||
|
|
|
@ -313,7 +313,7 @@ export const TodoAppPage: React.FC<{
|
|||
|
||||
function withDefaultState<State extends BaseState>(
|
||||
stateContainer: BaseStateContainer<State>,
|
||||
// eslint-disable-next-line no-shadow
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
defaultState: State
|
||||
): INullableBaseStateContainer<State> {
|
||||
return {
|
||||
|
|
|
@ -180,6 +180,7 @@ function useGlobalStateSyncing(
|
|||
}, [query, kbnUrlStateStorage]);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
function useAppStateSyncing<AppState extends QueryState>(
|
||||
appStateContainer: BaseStateContainer<AppState>,
|
||||
query: DataPublicPluginStart['query'],
|
||||
|
|
|
@ -564,8 +564,8 @@
|
|||
"@types/xml2js": "^0.4.5",
|
||||
"@types/yauzl": "^2.9.1",
|
||||
"@types/zen-observable": "^0.8.0",
|
||||
"@typescript-eslint/eslint-plugin": "^3.10.0",
|
||||
"@typescript-eslint/parser": "^3.10.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.8.1",
|
||||
"@typescript-eslint/parser": "^4.8.1",
|
||||
"@welldone-software/why-did-you-render": "^5.0.0",
|
||||
"@yarnpkg/lockfile": "^1.1.0",
|
||||
"abab": "^1.0.4",
|
||||
|
@ -641,7 +641,7 @@
|
|||
"eslint-plugin-prefer-object-spread": "^1.2.1",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
"eslint-plugin-react": "^7.20.3",
|
||||
"eslint-plugin-react-hooks": "^4.0.4",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"eslint-plugin-react-perf": "^3.2.3",
|
||||
"expose-loader": "^0.7.5",
|
||||
"faker": "1.1.0",
|
||||
|
|
|
@ -190,6 +190,11 @@ module.exports = {
|
|||
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
||||
'@typescript-eslint/no-misused-new': 'error',
|
||||
'@typescript-eslint/no-namespace': 'error',
|
||||
'@typescript-eslint/no-shadow': 'error',
|
||||
// rely on typescript
|
||||
'@typescript-eslint/no-undef': 'off',
|
||||
'no-undef': 'off',
|
||||
|
||||
'@typescript-eslint/triple-slash-reference': ['error', {
|
||||
path: 'never',
|
||||
types: 'never',
|
||||
|
@ -219,7 +224,6 @@ module.exports = {
|
|||
'no-eval': 'error',
|
||||
'no-new-wrappers': 'error',
|
||||
'no-script-url': 'error',
|
||||
'no-shadow': 'error',
|
||||
'no-throw-literal': 'error',
|
||||
'no-undef-init': 'error',
|
||||
'no-unsafe-finally': 'error',
|
||||
|
|
|
@ -130,7 +130,7 @@ type BufferEncoding =
|
|||
| 'binary'
|
||||
| 'hex';
|
||||
|
||||
/* eslint-disable no-bitwise, no-shadow */
|
||||
/* eslint-disable no-bitwise, @typescript-eslint/no-shadow */
|
||||
export class Sha256 {
|
||||
private _a: number;
|
||||
private _b: number;
|
||||
|
|
|
@ -143,8 +143,8 @@ export type RouteValidatorFullConfig<P, Q, B> = RouteValidatorConfig<P, Q, B> &
|
|||
* @internal
|
||||
*/
|
||||
export class RouteValidator<P = {}, Q = {}, B = {}> {
|
||||
public static from<P = {}, Q = {}, B = {}>(
|
||||
opts: RouteValidator<P, Q, B> | RouteValidatorFullConfig<P, Q, B>
|
||||
public static from<_P = {}, _Q = {}, _B = {}>(
|
||||
opts: RouteValidator<_P, _Q, _B> | RouteValidatorFullConfig<_P, _Q, _B>
|
||||
) {
|
||||
if (opts instanceof RouteValidator) {
|
||||
return opts;
|
||||
|
|
|
@ -118,16 +118,16 @@ export const useField = <T, FormType = FormData, I = T>(
|
|||
* updating the "value" state.
|
||||
*/
|
||||
const formatInputValue = useCallback(
|
||||
<T>(inputValue: unknown): T => {
|
||||
<U>(inputValue: unknown): U => {
|
||||
const isEmptyString = typeof inputValue === 'string' && inputValue.trim() === '';
|
||||
|
||||
if (isEmptyString || !formatters) {
|
||||
return inputValue as T;
|
||||
return inputValue as U;
|
||||
}
|
||||
|
||||
const formData = __getFormData$().value;
|
||||
|
||||
return formatters.reduce((output, formatter) => formatter(output, formData), inputValue) as T;
|
||||
return formatters.reduce((output, formatter) => formatter(output, formData), inputValue) as U;
|
||||
},
|
||||
[formatters, __getFormData$]
|
||||
);
|
||||
|
|
|
@ -97,11 +97,11 @@ test('context receives stateContainer', () => {
|
|||
const { Provider, context } = createStateContainerReactHelpers<typeof stateContainer>();
|
||||
|
||||
ReactDOM.render(
|
||||
/* eslint-disable no-shadow */
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
<Provider value={stateContainer}>
|
||||
<context.Consumer>{(stateContainer) => stateContainer.get().foo}</context.Consumer>
|
||||
</Provider>,
|
||||
/* eslint-enable no-shadow */
|
||||
/* eslint-enable @typescript-eslint/no-shadow */
|
||||
container
|
||||
);
|
||||
|
||||
|
@ -116,7 +116,7 @@ describe('hooks', () => {
|
|||
const stateContainer = createStateContainer({ foo: 'bar' });
|
||||
const { Provider, useContainer } = createStateContainerReactHelpers<typeof stateContainer>();
|
||||
const Demo: React.FC<{}> = () => {
|
||||
// eslint-disable-next-line no-shadow
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
const stateContainer = useContainer();
|
||||
return <>{stateContainer.get().foo}</>;
|
||||
};
|
||||
|
|
|
@ -56,9 +56,9 @@ export const result = Promise.resolve()
|
|||
});
|
||||
|
||||
function withDefaultState<State extends BaseState>(
|
||||
// eslint-disable-next-line no-shadow
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
stateContainer: BaseStateContainer<State>,
|
||||
// eslint-disable-next-line no-shadow
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
defaultState: State
|
||||
): INullableBaseStateContainer<State> {
|
||||
return {
|
||||
|
|
|
@ -354,7 +354,7 @@ describe('state_sync', () => {
|
|||
|
||||
function withDefaultState<State extends BaseState>(
|
||||
stateContainer: BaseStateContainer<State>,
|
||||
// eslint-disable-next-line no-shadow
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
defaultState: State
|
||||
): INullableBaseStateContainer<State> {
|
||||
return {
|
||||
|
|
|
@ -38,7 +38,6 @@ function HasExtendedBoundsParamEditor(props: AggParamEditorProps<boolean>) {
|
|||
|
||||
setValue(value && agg.params.min_doc_count);
|
||||
}
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
}, [agg.params.min_doc_count, setValue, value]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -97,13 +97,13 @@ export class Vis<TVisParams = VisParams> {
|
|||
public readonly uiState: PersistedState;
|
||||
|
||||
constructor(visType: string, visState: SerializedVis = {} as any) {
|
||||
this.type = this.getType<TVisParams>(visType);
|
||||
this.type = this.getType(visType);
|
||||
this.params = this.getParams(visState.params);
|
||||
this.uiState = new PersistedState(visState.uiState);
|
||||
this.id = visState.id;
|
||||
}
|
||||
|
||||
private getType<TVisParams>(visType: string) {
|
||||
private getType(visType: string) {
|
||||
const type = getTypes().get<TVisParams>(visType);
|
||||
if (!type) {
|
||||
const errorMessage = i18n.translate('visualizations.visualizationTypeInvalidMessage', {
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
"types": [
|
||||
"node",
|
||||
"jest",
|
||||
"react",
|
||||
"flot",
|
||||
"jest-styled-components",
|
||||
"@testing-library/jest-dom"
|
||||
|
|
|
@ -81,7 +81,6 @@ export function AgentConfigurationCreateEdit({
|
|||
..._newConfig,
|
||||
settings: existingConfig?.settings || {},
|
||||
}));
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
}, [existingConfig]);
|
||||
|
||||
// update newConfig when existingConfig has loaded
|
||||
|
|
|
@ -65,7 +65,6 @@ export function TransactionActionMenu({ transaction }: Props) {
|
|||
{ key: 'transaction.name', value: transaction?.transaction.name },
|
||||
{ key: 'transaction.type', value: transaction?.transaction.type },
|
||||
].filter((filter): filter is Filter => typeof filter.value === 'string'),
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[transaction]
|
||||
);
|
||||
|
||||
|
|
6
x-pack/plugins/apm/typings/common.d.ts
vendored
6
x-pack/plugins/apm/typings/common.d.ts
vendored
|
@ -3,7 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import type { UnwrapPromise } from '@kbn/utility-types';
|
||||
import '../../../typings/rison_node';
|
||||
import '../../infra/types/eui';
|
||||
// EUIBasicTable
|
||||
|
@ -21,8 +21,6 @@ type AllowUnknownObjectProperties<T> = T extends object
|
|||
}
|
||||
: T;
|
||||
|
||||
export type PromiseValueType<Value> = Value extends Promise<infer Value>
|
||||
? Value
|
||||
: Value;
|
||||
export type PromiseValueType<T extends Promise<any>> = UnwrapPromise<T>;
|
||||
|
||||
export type Maybe<T> = T | null | undefined;
|
||||
|
|
|
@ -39,7 +39,7 @@ jest.mock('../../supported_renderers');
|
|||
jest.mock('@elastic/eui/lib/components/portal/portal', () => {
|
||||
// Local constants are not supported in Jest mocks-- they must be
|
||||
// imported within the mock.
|
||||
// eslint-disable-next-line no-shadow
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
const React = jest.requireActual('react');
|
||||
return {
|
||||
EuiPortal: (props: any) => <div>{props.children}</div>,
|
||||
|
|
|
@ -25,7 +25,7 @@ jest.mock('@elastic/eui/lib/services/accessibility', () => {
|
|||
};
|
||||
});
|
||||
jest.mock('@elastic/eui/lib/components/portal/portal', () => {
|
||||
// eslint-disable-next-line no-shadow
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
const React = jest.requireActual('react');
|
||||
return {
|
||||
EuiPortal: (props: any) => <div>{props.children}</div>,
|
||||
|
|
|
@ -47,6 +47,7 @@ export const PackagePolicyInputConfig: React.FunctionComponent<{
|
|||
const hasErrors = forceShowErrors && validationHasErrors(inputVarsValidationResults);
|
||||
|
||||
const requiredVars: RegistryVarsEntry[] = [];
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const advancedVars: RegistryVarsEntry[] = [];
|
||||
|
||||
if (packageInputVars) {
|
||||
|
|
|
@ -49,6 +49,7 @@ export const PackagePolicyInputStreamConfig: React.FunctionComponent<{
|
|||
const hasErrors = forceShowErrors && validationHasErrors(inputStreamValidationResults);
|
||||
|
||||
const requiredVars: RegistryVarsEntry[] = [];
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const advancedVars: RegistryVarsEntry[] = [];
|
||||
|
||||
if (packageInputStream.vars && packageInputStream.vars.length) {
|
||||
|
|
|
@ -91,6 +91,7 @@ export const StepSelectAgentPolicy: React.FunctionComponent<{
|
|||
sortOrder: 'asc',
|
||||
full: true,
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const agentPolicies = agentPoliciesData?.items || [];
|
||||
const agentPoliciesById = agentPolicies.reduce(
|
||||
(acc: { [key: string]: GetAgentPoliciesResponseItem }, policy) => {
|
||||
|
@ -131,6 +132,7 @@ export const StepSelectAgentPolicy: React.FunctionComponent<{
|
|||
}
|
||||
}, [selectedPolicyId, agentPolicy, updateAgentPolicy, setIsLoadingSecondStep]);
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const agentPolicyOptions: Array<EuiComboBoxOptionOption<string>> = packageInfoData
|
||||
? agentPolicies.map((agentConf) => {
|
||||
const alreadyHasLimitedPackage =
|
||||
|
|
|
@ -278,6 +278,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => {
|
|||
perPage: 1000,
|
||||
});
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const agentPolicies = agentPoliciesRequest.data ? agentPoliciesRequest.data.items : [];
|
||||
const agentPoliciesIndexedById = useMemo(() => {
|
||||
return agentPolicies.reduce((acc, agentPolicy) => {
|
||||
|
|
|
@ -49,6 +49,7 @@ export const AgentReassignAgentPolicyFlyout: React.FunctionComponent<Props> = ({
|
|||
page: 1,
|
||||
perPage: 1000,
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const agentPolicies = agentPoliciesRequest.data ? agentPoliciesRequest.data.items : [];
|
||||
useEffect(() => {
|
||||
if (!selectedAgentPolicyId && agentPolicies[0]) {
|
||||
|
|
|
@ -37,7 +37,7 @@ export function PackageListGrid({ isLoading, controls, title, list }: ListProps)
|
|||
const localSearchRef = useLocalSearch(list);
|
||||
|
||||
const onQueryChange = ({
|
||||
// eslint-disable-next-line no-shadow
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
query,
|
||||
queryText: userInput,
|
||||
error,
|
||||
|
|
|
@ -105,6 +105,7 @@ export const TemplateForm = ({
|
|||
aliases: true,
|
||||
});
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const indexTemplate = defaultValue ?? {
|
||||
name: '',
|
||||
indexPatterns: [],
|
||||
|
|
|
@ -147,7 +147,6 @@ export const Expressions: React.FC<Props> = (props) => {
|
|||
timeUnit: timeUnit ?? defaultExpression.timeUnit,
|
||||
});
|
||||
setAlertParams('criteria', exp);
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
}, [setAlertParams, alertParams.criteria, timeSize, timeUnit]);
|
||||
|
||||
const removeExpression = useCallback(
|
||||
|
|
|
@ -91,6 +91,7 @@ export const MetricExpression = ({
|
|||
const [selectedOption, setSelectedOption] = useState(metric?.value);
|
||||
const [fieldDisplayedCustomLabel, setFieldDisplayedCustomLabel] = useState(customMetric?.label);
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const firstFieldOption = {
|
||||
text: i18n.translate('xpack.infra.metrics.alertFlyout.expression.metric.selectFieldLabel', {
|
||||
defaultMessage: 'Select a metric',
|
||||
|
@ -106,16 +107,11 @@ export const MetricExpression = ({
|
|||
[fields, customMetric?.field]
|
||||
);
|
||||
|
||||
const expressionDisplayValue = useMemo(
|
||||
() => {
|
||||
return customMetricTabOpen
|
||||
? customMetric?.field && getCustomMetricLabel(customMetric)
|
||||
: metric?.text || firstFieldOption.text;
|
||||
},
|
||||
// The ?s are confusing eslint here, so...
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[customMetricTabOpen, metric, customMetric, firstFieldOption]
|
||||
);
|
||||
const expressionDisplayValue = useMemo(() => {
|
||||
return customMetricTabOpen
|
||||
? customMetric?.field && getCustomMetricLabel(customMetric)
|
||||
: metric?.text || firstFieldOption.text;
|
||||
}, [customMetricTabOpen, metric, customMetric, firstFieldOption]);
|
||||
|
||||
const onChangeTab = useCallback(
|
||||
(id) => {
|
||||
|
|
|
@ -157,7 +157,6 @@ export const Editor: React.FC<Props> = (props) => {
|
|||
} else {
|
||||
return [];
|
||||
}
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
}, [sourceStatus]);
|
||||
|
||||
const groupByFields = useMemo(() => {
|
||||
|
@ -168,7 +167,6 @@ export const Editor: React.FC<Props> = (props) => {
|
|||
} else {
|
||||
return [];
|
||||
}
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
}, [sourceStatus]);
|
||||
|
||||
const updateThreshold = useCallback(
|
||||
|
|
|
@ -96,7 +96,6 @@ export const Expressions: React.FC<Props> = (props) => {
|
|||
aggregation: 'avg',
|
||||
};
|
||||
}
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
}, [alertsContext.metadata]);
|
||||
|
||||
const updateParams = useCallback(
|
||||
|
@ -116,7 +115,6 @@ export const Expressions: React.FC<Props> = (props) => {
|
|||
timeUnit: timeUnit ?? defaultExpression.timeUnit,
|
||||
});
|
||||
setAlertParams('criteria', exp);
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
}, [setAlertParams, alertParams.criteria, timeSize, timeUnit]);
|
||||
|
||||
const removeExpression = useCallback(
|
||||
|
@ -127,7 +125,6 @@ export const Expressions: React.FC<Props> = (props) => {
|
|||
setAlertParams('criteria', exp);
|
||||
}
|
||||
},
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[setAlertParams, alertParams.criteria]
|
||||
);
|
||||
|
||||
|
@ -172,7 +169,6 @@ export const Expressions: React.FC<Props> = (props) => {
|
|||
setTimeSize(ts || undefined);
|
||||
setAlertParams('criteria', criteria);
|
||||
},
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[alertParams.criteria, setAlertParams]
|
||||
);
|
||||
|
||||
|
@ -186,7 +182,6 @@ export const Expressions: React.FC<Props> = (props) => {
|
|||
setTimeUnit(tu as Unit);
|
||||
setAlertParams('criteria', criteria);
|
||||
},
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[alertParams.criteria, setAlertParams]
|
||||
);
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ interface HeaderProps {
|
|||
export const Header = ({ breadcrumbs = [], readOnlyBadge = false }: HeaderProps) => {
|
||||
const chrome = useKibana().services.chrome;
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const badge = readOnlyBadge
|
||||
? {
|
||||
text: i18n.translate('xpack.infra.header.badge.readOnly.text', {
|
||||
|
@ -31,12 +32,10 @@ export const Header = ({ breadcrumbs = [], readOnlyBadge = false }: HeaderProps)
|
|||
|
||||
const setBreadcrumbs = useCallback(() => {
|
||||
return chrome?.setBreadcrumbs(breadcrumbs || []);
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
}, [breadcrumbs, chrome]);
|
||||
|
||||
const setBadge = useCallback(() => {
|
||||
return chrome?.setBadge(badge);
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
}, [badge, chrome]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
@ -60,7 +60,7 @@ export function SavedViewListModal<ViewState extends { id: string; name: string
|
|||
key: v.id,
|
||||
checked: currentView?.id === v.id ? 'on' : undefined,
|
||||
}));
|
||||
}, [views, currentView]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
}, [views, currentView]);
|
||||
|
||||
return (
|
||||
<EuiOverlayMask>
|
||||
|
|
|
@ -82,7 +82,6 @@ export const useLogFilterState: (props: {
|
|||
}
|
||||
|
||||
return true;
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
}, [filterQueryDraft]);
|
||||
|
||||
const serializedFilterQuery = useMemo(() => (filterQuery ? filterQuery.serializedQuery : null), [
|
||||
|
|
|
@ -91,7 +91,6 @@ export const useLogSource = ({ sourceId, fetch }: { sourceId: string; fetch: Htt
|
|||
fields: sourceStatus?.logIndexFields ?? [],
|
||||
title: sourceConfiguration?.configuration.name ?? 'unknown',
|
||||
}),
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[sourceConfiguration, sourceStatus]
|
||||
);
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ export const useSourceViaHttp = ({
|
|||
title: pickIndexPattern(response?.source, indexType),
|
||||
};
|
||||
},
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[response, type]
|
||||
);
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ export const useBulkGetSavedObject = (type: string) => {
|
|||
};
|
||||
fetchData();
|
||||
},
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[type, kibana.services.savedObjects]
|
||||
);
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ export const useCreateSavedObject = (type: string) => {
|
|||
};
|
||||
save();
|
||||
},
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[type, kibana.services.savedObjects]
|
||||
);
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ export const useDeleteSavedObject = (type: string) => {
|
|||
};
|
||||
dobj();
|
||||
},
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[type, kibana.services.savedObjects]
|
||||
);
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ export const useFindSavedObject = <SavedObjectType extends SavedObjectAttributes
|
|||
};
|
||||
fetchData();
|
||||
},
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[type, kibana.services.savedObjects]
|
||||
);
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ export const useGetSavedObject = <SavedObjectType extends SavedObjectAttributes>
|
|||
};
|
||||
fetchData();
|
||||
},
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[type, kibana.services.savedObjects]
|
||||
);
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ export const useUpdateSavedObject = (type: string) => {
|
|||
};
|
||||
save();
|
||||
},
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[type, kibana.services.savedObjects]
|
||||
);
|
||||
|
||||
|
|
|
@ -77,7 +77,6 @@ export const LogEntryCategoriesResultsContent: React.FunctionComponent<LogEntryC
|
|||
title: loadDataErrorTitle,
|
||||
});
|
||||
},
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[services.notifications]
|
||||
);
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ export const LogsSettingsPage = () => {
|
|||
|
||||
const availableFields = useMemo(
|
||||
() => sourceStatus?.logIndexFields.map((field) => field.name) ?? [],
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
[sourceStatus]
|
||||
);
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ export const NodeContextPopover = ({
|
|||
options,
|
||||
onClose,
|
||||
}: Props) => {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const tabConfigs = [MetricsTab, LogsTab, ProcessesTab, PropertiesTab];
|
||||
|
||||
const tabs = useMemo(() => {
|
||||
|
|
|
@ -23,7 +23,6 @@ export const SubSection: FunctionComponent<SubSectionProps> = ({
|
|||
isLiveStreaming,
|
||||
stopLiveStreaming,
|
||||
}) => {
|
||||
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||
const metric = useMemo(() => metrics?.find((m) => m.id === id), [id, metrics]);
|
||||
|
||||
if (!children || !metric) {
|
||||
|
|
|
@ -44,7 +44,7 @@ import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/p
|
|||
jest.mock('../editor_frame_service/editor_frame/expression_helpers');
|
||||
jest.mock('src/core/public');
|
||||
jest.mock('../../../../../src/plugins/saved_objects/public', () => {
|
||||
// eslint-disable-next-line no-shadow
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
const { SavedObjectSaveModal, SavedObjectSaveModalOrigin } = jest.requireActual(
|
||||
'../../../../../src/plugins/saved_objects/public'
|
||||
);
|
||||
|
|
|
@ -273,6 +273,7 @@ export function SuggestionPanel({
|
|||
return (props: ReactExpressionRendererProps) => (
|
||||
<ExpressionRendererComponent {...props} searchContext={context} reload$={autoRefreshFetch$} />
|
||||
);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [plugins.data.query.timefilter.timefilter, context]);
|
||||
|
||||
const [lastSelectedSuggestion, setLastSelectedSuggestion] = useState<number>(-1);
|
||||
|
|
|
@ -39,6 +39,7 @@ function App() {
|
|||
const Wrapper = () => {
|
||||
const { core } = usePluginContext();
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const breadcrumb = [observabilityLabelBreadcrumb, ...route.breadcrumb];
|
||||
useEffect(() => {
|
||||
core.chrome.setBreadcrumbs(breadcrumb);
|
||||
|
|
|
@ -60,7 +60,7 @@ export interface MatrixHistogramSchema<T> {
|
|||
buildDsl: (options: MatrixHistogramRequestOptions) => {};
|
||||
aggName: string;
|
||||
parseKey: string;
|
||||
parser?: <T>(data: MatrixHistogramParseData<T>, keyBucket: string) => MatrixHistogramData[];
|
||||
parser?: <U>(data: MatrixHistogramParseData<U>, keyBucket: string) => MatrixHistogramData[];
|
||||
}
|
||||
|
||||
export type MatrixHistogramParseData<T> = T extends MatrixHistogramType.alerts
|
||||
|
|
|
@ -99,7 +99,6 @@ const DraggableWrapperHoverContentComponent: React.FC<Props> = ({
|
|||
onFilterAdded();
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [closePopOver, field, value, filterManager, onFilterAdded]);
|
||||
|
||||
const filterOutValue = useCallback(() => {
|
||||
|
@ -117,7 +116,6 @@ const DraggableWrapperHoverContentComponent: React.FC<Props> = ({
|
|||
onFilterAdded();
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [closePopOver, field, value, filterManager, onFilterAdded]);
|
||||
|
||||
const handleGoGetTimelineId = useCallback(() => {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import type React from 'react';
|
||||
export type TitleProp = string | React.ReactNode;
|
||||
|
||||
export interface DraggableArguments {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import type React from 'react';
|
||||
import { EuiTitleSize } from '@elastic/eui';
|
||||
import { ScaleType, Position, TickFormatter } from '@elastic/charts';
|
||||
import { ActionCreator } from 'redux';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import type React from 'react';
|
||||
import uuid from 'uuid';
|
||||
import { isError } from 'lodash/fp';
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ export type CreateStructuredSelector = <
|
|||
>(
|
||||
selectorMap: SelectorMap
|
||||
) => (
|
||||
state: SelectorMap[keyof SelectorMap] extends (state: infer State) => unknown ? State : never
|
||||
state: SelectorMap[keyof SelectorMap] extends (state: infer S) => unknown ? S : never
|
||||
) => {
|
||||
[Key in keyof SelectorMap]: ReturnType<SelectorMap[Key]>;
|
||||
};
|
||||
|
|
|
@ -171,7 +171,6 @@ export const AlertsHistogramPanel = memo<AlertsHistogramPanelProps>(
|
|||
value: bucket.key,
|
||||
}))
|
||||
: NO_LEGEND_DATA,
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[alertsData, selectedStackByOption.value, timelineId]
|
||||
);
|
||||
|
||||
|
|
|
@ -203,6 +203,7 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps> = ({
|
|||
setEventsLoading,
|
||||
]);
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const openAlertActionComponent = (
|
||||
<EuiContextMenuItem
|
||||
key="open-alert"
|
||||
|
@ -235,6 +236,7 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps> = ({
|
|||
setEventsLoading,
|
||||
]);
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const closeAlertActionComponent = (
|
||||
<EuiContextMenuItem
|
||||
key="close-alert"
|
||||
|
@ -267,6 +269,7 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps> = ({
|
|||
setEventsLoading,
|
||||
]);
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const inProgressAlertActionComponent = (
|
||||
<EuiContextMenuItem
|
||||
key="in-progress-alert"
|
||||
|
@ -296,6 +299,7 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps> = ({
|
|||
setOpenAddExceptionModal('endpoint');
|
||||
}, [closePopover]);
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const addEndpointExceptionComponent = (
|
||||
<EuiContextMenuItem
|
||||
key="add-endpoint-exception-menu-item"
|
||||
|
@ -320,6 +324,7 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps> = ({
|
|||
return !isMlRule(ruleType) && !isThresholdRule(ruleType);
|
||||
}, [ecsRowData]);
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const addExceptionComponent = (
|
||||
<EuiContextMenuItem
|
||||
key="add-exception-menu-item"
|
||||
|
|
|
@ -42,6 +42,7 @@ export const useRules = ({
|
|||
const [loading, setLoading] = useState(true);
|
||||
const [, dispatchToaster] = useStateToaster();
|
||||
|
||||
const filterTags = filterOptions.tags?.sort().join();
|
||||
useEffect(() => {
|
||||
let isSubscribed = true;
|
||||
const abortCtrl = new AbortController();
|
||||
|
@ -96,8 +97,7 @@ export const useRules = ({
|
|||
filterOptions.filter,
|
||||
filterOptions.sortField,
|
||||
filterOptions.sortOrder,
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
filterOptions.tags?.sort().join(),
|
||||
filterTags,
|
||||
filterOptions.showCustomRules,
|
||||
filterOptions.showElasticRules,
|
||||
refetchPrePackagedRulesStatus,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import type React from 'react';
|
||||
import { EuiBasicTable } from '@elastic/eui';
|
||||
import {
|
||||
FilterOptions,
|
||||
|
|
|
@ -281,7 +281,6 @@ export const RuleDetailsPageComponent: FC<PropsFromRedux> = ({
|
|||
date={rule?.last_failure_at}
|
||||
/>
|
||||
) : null,
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[rule, ruleDetailTab]
|
||||
);
|
||||
|
||||
|
|
|
@ -492,6 +492,7 @@ export const EndpointList = () => {
|
|||
],
|
||||
},
|
||||
];
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [formatUrl, queryParams, search, agentPolicies, services?.application?.getUrlForApp]);
|
||||
|
||||
const renderTableOrEmptyState = useMemo(() => {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import type React from 'react';
|
||||
export type OverviewStatId =
|
||||
| 'auditbeatAuditd'
|
||||
| 'auditbeatFIM'
|
||||
|
|
|
@ -103,9 +103,8 @@ export const terminatedProcesses = createSelector(resolverTreeResponse, function
|
|||
* A function that given an entity id returns a boolean indicating if the id is in the set of terminated processes.
|
||||
*/
|
||||
export const isProcessTerminated = createSelector(terminatedProcesses, function (
|
||||
/* eslint-disable no-shadow */
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
terminatedProcesses
|
||||
/* eslint-enable no-shadow */
|
||||
) {
|
||||
return (entityID: string) => {
|
||||
return terminatedProcesses.has(entityID);
|
||||
|
@ -137,9 +136,8 @@ export const graphableProcesses = createSelector(resolverTreeResponse, function
|
|||
* The 'indexed process tree' contains the tree data, indexed in helpful ways. Used for O(1) access to stuff during graph layout.
|
||||
*/
|
||||
export const tree = createSelector(graphableProcesses, function indexedTree(
|
||||
/* eslint-disable no-shadow */
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
graphableProcesses
|
||||
/* eslint-enable no-shadow */
|
||||
) {
|
||||
return indexedProcessTreeModel.factory(graphableProcesses);
|
||||
});
|
||||
|
@ -248,9 +246,8 @@ export const relatedEventsByCategory: (
|
|||
) => (node: string, eventCategory: string) => SafeResolverEvent[] = createSelector(
|
||||
relatedEventsByEntityId,
|
||||
function (
|
||||
/* eslint-disable no-shadow */
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
relatedEventsByEntityId
|
||||
/* eslint-enable no-shadow */
|
||||
) {
|
||||
// A map of nodeID -> event category -> SafeResolverEvent[]
|
||||
const nodeMap: Map<string, Map<string, SafeResolverEvent[]>> = new Map();
|
||||
|
@ -351,10 +348,9 @@ export const layout: (state: DataState) => IsometricTaxiLayout = createSelector(
|
|||
tree,
|
||||
originID,
|
||||
function processNodePositionsAndEdgeLineSegments(
|
||||
/* eslint-disable no-shadow */
|
||||
indexedProcessTree,
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
originID
|
||||
/* eslint-enable no-shadow */
|
||||
) {
|
||||
// use the isometric taxi layout as a base
|
||||
const taxiLayout = isometricTaxiLayoutModel.isometricTaxiLayoutFactory(indexedProcessTree);
|
||||
|
@ -650,7 +646,7 @@ export const relatedEventCountOfTypeForNode: (
|
|||
export const panelViewAndParameters = createSelector(
|
||||
(state: DataState) => state.locationSearch,
|
||||
resolverComponentInstanceID,
|
||||
/* eslint-disable-next-line no-shadow */
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
(locationSearch, resolverComponentInstanceID) => {
|
||||
return panelViewAndParametersFromLocationSearchAndResolverComponentInstanceID({
|
||||
locationSearch,
|
||||
|
@ -670,7 +666,7 @@ export const nodeEventsInCategory = (state: DataState) => {
|
|||
export const lastRelatedEventResponseContainsCursor = createSelector(
|
||||
(state: DataState) => state.nodeEventsInCategory,
|
||||
panelViewAndParameters,
|
||||
/* eslint-disable-next-line no-shadow */
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
function (nodeEventsInCategory, panelViewAndParameters) {
|
||||
if (
|
||||
nodeEventsInCategory !== undefined &&
|
||||
|
@ -689,7 +685,7 @@ export const lastRelatedEventResponseContainsCursor = createSelector(
|
|||
export const hadErrorLoadingNodeEventsInCategory = createSelector(
|
||||
(state: DataState) => state.nodeEventsInCategory,
|
||||
panelViewAndParameters,
|
||||
/* eslint-disable-next-line no-shadow */
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
function (nodeEventsInCategory, panelViewAndParameters) {
|
||||
if (
|
||||
nodeEventsInCategory !== undefined &&
|
||||
|
@ -708,7 +704,7 @@ export const hadErrorLoadingNodeEventsInCategory = createSelector(
|
|||
export const isLoadingNodeEventsInCategory = createSelector(
|
||||
(state: DataState) => state.nodeEventsInCategory,
|
||||
panelViewAndParameters,
|
||||
/* eslint-disable-next-line no-shadow */
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
function (nodeEventsInCategory, panelViewAndParameters) {
|
||||
const { panelView } = panelViewAndParameters;
|
||||
return panelView === 'nodeEventsInCategory' && nodeEventsInCategory === undefined;
|
||||
|
@ -718,7 +714,7 @@ export const isLoadingNodeEventsInCategory = createSelector(
|
|||
export const isLoadingMoreNodeEventsInCategory = createSelector(
|
||||
(state: DataState) => state.nodeEventsInCategory,
|
||||
panelViewAndParameters,
|
||||
/* eslint-disable-next-line no-shadow */
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
function (nodeEventsInCategory, panelViewAndParameters) {
|
||||
if (
|
||||
nodeEventsInCategory !== undefined &&
|
||||
|
|
|
@ -257,10 +257,10 @@ export const relatedEventTotalForProcess = composeSelectors(
|
|||
* animated. So in order to get the currently visible entities, we need to pass in time.
|
||||
*/
|
||||
export const visibleNodesAndEdgeLines = createSelector(nodesAndEdgelines, boundingBox, function (
|
||||
/* eslint-disable no-shadow */
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
nodesAndEdgelines,
|
||||
boundingBox
|
||||
/* eslint-enable no-shadow */
|
||||
/* eslint-enable @typescript-eslint/no-shadow */
|
||||
) {
|
||||
// `boundingBox` and `nodesAndEdgelines` are each memoized.
|
||||
return (time: number) => nodesAndEdgelines(boundingBox(time));
|
||||
|
|
|
@ -16,7 +16,7 @@ import { parameterName } from '../parameter_name';
|
|||
*/
|
||||
export const ariaActiveDescendant = createSelector(
|
||||
(uiState: ResolverUIState) => uiState,
|
||||
/* eslint-disable no-shadow */
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
({ ariaActiveDescendant }) => {
|
||||
return ariaActiveDescendant;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ export const ariaActiveDescendant = createSelector(
|
|||
*/
|
||||
export const selectedNode = createSelector(
|
||||
(uiState: ResolverUIState) => uiState,
|
||||
/* eslint-disable no-shadow */
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
({ selectedNode }: ResolverUIState) => {
|
||||
return selectedNode;
|
||||
}
|
||||
|
@ -83,6 +83,7 @@ export const relatedEventsRelativeHrefs: (
|
|||
) => (
|
||||
categories: Record<string, number> | undefined,
|
||||
nodeID: string
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
) => Map<string, string | undefined> = createSelector(relativeHref, (relativeHref) => {
|
||||
return (categories: Record<string, number> | undefined, nodeID: string) => {
|
||||
const hrefsByCategory = new Map<string, string | undefined>();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
/* eslint-disable no-duplicate-imports */
|
||||
|
||||
import type React from 'react';
|
||||
import { Store } from 'redux';
|
||||
import { Middleware, Dispatch } from 'redux';
|
||||
import { BBox } from 'rbush';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { SetStateAction, Dispatch } from 'react';
|
||||
import type React from 'react';
|
||||
import { AllTimelinesVariables } from '../../containers/all';
|
||||
import { TimelineModel } from '../../../timelines/store/timeline/model';
|
||||
import { NoteResult } from '../../../graphql/types';
|
||||
|
@ -93,7 +93,9 @@ export type OnOpenTimeline = ({
|
|||
}) => void;
|
||||
|
||||
export type OnOpenDeleteTimelineModal = (selectedItem: OpenTimelineResult) => void;
|
||||
export type SetActionTimeline = Dispatch<SetStateAction<OpenTimelineResult | undefined>>;
|
||||
export type SetActionTimeline = React.Dispatch<
|
||||
React.SetStateAction<OpenTimelineResult | undefined>
|
||||
>;
|
||||
export type EnableExportTimelineDownloader = (selectedItem: OpenTimelineResult) => void;
|
||||
/** Invoked when the user presses enters to submit the text in the search input */
|
||||
export type OnQueryChange = (query: EuiSearchBarQuery) => void;
|
||||
|
|
|
@ -31,7 +31,7 @@ export const eventHasNotes = (noteIds: string[]): boolean => !isEmpty(noteIds);
|
|||
|
||||
export const getPinTooltip = ({
|
||||
isPinned,
|
||||
// eslint-disable-next-line no-shadow
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
eventHasNotes,
|
||||
timelineType,
|
||||
}: {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import type React from 'react';
|
||||
import { TimelineNonEcsData } from '../../../../../../common/search_strategy/timeline';
|
||||
import { ColumnHeaderOptions } from '../../../../../timelines/store/timeline/model';
|
||||
|
||||
|
|
|
@ -36,10 +36,12 @@ export const BoundaryIndexExpression: FunctionComponent<Props> = ({
|
|||
setBoundaryGeoField,
|
||||
setBoundaryNameField,
|
||||
}) => {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const BOUNDARY_NAME_ENTITY_TYPES = ['string', 'number', 'ip'];
|
||||
const { dataUi, dataIndexPatterns, http } = alertsContext;
|
||||
const IndexPatternSelect = (dataUi && dataUi.IndexPatternSelect) || null;
|
||||
const { boundaryGeoField } = alertParams;
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const nothingSelected: IFieldType = {
|
||||
name: '<nothing selected>',
|
||||
type: 'string',
|
||||
|
|
|
@ -28,6 +28,7 @@ export const EntityByExpression: FunctionComponent<Props> = ({
|
|||
indexFields,
|
||||
isInvalid,
|
||||
}) => {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const ENTITY_TYPES = ['string', 'number', 'ip'];
|
||||
|
||||
const usePrevious = <T extends unknown>(value: T): T | undefined => {
|
||||
|
|
|
@ -57,6 +57,7 @@ export const ConnectorAddModal = ({
|
|||
consumer,
|
||||
}: ConnectorAddModalProps) => {
|
||||
let hasErrors = false;
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const initialConnector = {
|
||||
actionTypeId: actionType.id,
|
||||
config: {},
|
||||
|
|
|
@ -36,6 +36,7 @@ export const AlertAdd = ({
|
|||
alertTypeId,
|
||||
initialValues,
|
||||
}: AlertAddProps) => {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const initialAlert = ({
|
||||
params: {},
|
||||
consumer,
|
||||
|
|
|
@ -332,7 +332,7 @@ export const getTestScenarios = <T>(modifiers?: T[]) => {
|
|||
},
|
||||
];
|
||||
if (modifiers) {
|
||||
const addModifier = <T>(list: T[]) =>
|
||||
const addModifier = <U>(list: U[]) =>
|
||||
list.map((x) => modifiers.map((modifier) => ({ ...x, modifier }))).flat();
|
||||
spaces = addModifier(spaces);
|
||||
security = addModifier(security);
|
||||
|
|
111
yarn.lock
111
yarn.lock
|
@ -4650,11 +4650,6 @@
|
|||
"@types/cheerio" "*"
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/eslint-visitor-keys@^1.0.0":
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
|
||||
integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==
|
||||
|
||||
"@types/eslint@^6.1.3":
|
||||
version "6.1.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-6.1.3.tgz#ec2a66e445a48efaa234020eb3b6e8f06afc9c61"
|
||||
|
@ -6052,26 +6047,28 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d"
|
||||
integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg==
|
||||
|
||||
"@typescript-eslint/eslint-plugin@^3.10.0":
|
||||
version "3.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.0.tgz#40fd53e81639c0d1a515b44e5fdf4c03dfd3cd39"
|
||||
integrity sha512-Bbeg9JAnSzZ85Y0gpInZscSpifA6SbEgRryaKdP5ZlUjhTKsvZS4GUIE6xAZCjhNTrf4zXXsySo83ZdHL7it0w==
|
||||
"@typescript-eslint/eslint-plugin@^4.8.1":
|
||||
version "4.8.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.8.1.tgz#b362abe0ee478a6c6d06c14552a6497f0b480769"
|
||||
integrity sha512-d7LeQ7dbUrIv5YVFNzGgaW3IQKMmnmKFneRWagRlGYOSfLJVaRbj/FrBNOBC1a3tVO+TgNq1GbHvRtg1kwL0FQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/experimental-utils" "3.10.0"
|
||||
"@typescript-eslint/experimental-utils" "4.8.1"
|
||||
"@typescript-eslint/scope-manager" "4.8.1"
|
||||
debug "^4.1.1"
|
||||
functional-red-black-tree "^1.0.1"
|
||||
regexpp "^3.0.0"
|
||||
semver "^7.3.2"
|
||||
tsutils "^3.17.1"
|
||||
|
||||
"@typescript-eslint/experimental-utils@3.10.0":
|
||||
version "3.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.0.tgz#f97a669a84a78319ab324cd51169d0c52853a360"
|
||||
integrity sha512-e5ZLSTuXgqC/Gq3QzK2orjlhTZVXzwxDujQmTBOM1NIVBZgW3wiIZjaXuVutk9R4UltFlwC9UD2+bdxsA7yyNg==
|
||||
"@typescript-eslint/experimental-utils@4.8.1":
|
||||
version "4.8.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.8.1.tgz#27275c20fa4336df99ebcf6195f7d7aa7aa9f22d"
|
||||
integrity sha512-WigyLn144R3+lGATXW4nNcDJ9JlTkG8YdBWHkDlN0lC3gUGtDi7Pe3h5GPvFKMcRz8KbZpm9FJV9NTW8CpRHpg==
|
||||
dependencies:
|
||||
"@types/json-schema" "^7.0.3"
|
||||
"@typescript-eslint/types" "3.10.0"
|
||||
"@typescript-eslint/typescript-estree" "3.10.0"
|
||||
"@typescript-eslint/scope-manager" "4.8.1"
|
||||
"@typescript-eslint/types" "4.8.1"
|
||||
"@typescript-eslint/typescript-estree" "4.8.1"
|
||||
eslint-scope "^5.0.0"
|
||||
eslint-utils "^2.0.0"
|
||||
|
||||
|
@ -6087,16 +6084,15 @@
|
|||
eslint-scope "^5.0.0"
|
||||
eslint-utils "^2.0.0"
|
||||
|
||||
"@typescript-eslint/parser@^3.10.0":
|
||||
version "3.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.10.0.tgz#820322d990a82265a78f4c1fc9aae03ce95b76ac"
|
||||
integrity sha512-iJyf3f2HVwscvJR7ySGMXw2DJgIAPKEz8TeU17XVKzgJRV4/VgCeDFcqLzueRe7iFI2gv+Tln4AV88ZOnsCNXg==
|
||||
"@typescript-eslint/parser@^4.8.1":
|
||||
version "4.8.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.8.1.tgz#4fe2fbdbb67485bafc4320b3ae91e34efe1219d1"
|
||||
integrity sha512-QND8XSVetATHK9y2Ltc/XBl5Ro7Y62YuZKnPEwnNPB8E379fDsvzJ1dMJ46fg/VOmk0hXhatc+GXs5MaXuL5Uw==
|
||||
dependencies:
|
||||
"@types/eslint-visitor-keys" "^1.0.0"
|
||||
"@typescript-eslint/experimental-utils" "3.10.0"
|
||||
"@typescript-eslint/types" "3.10.0"
|
||||
"@typescript-eslint/typescript-estree" "3.10.0"
|
||||
eslint-visitor-keys "^1.1.0"
|
||||
"@typescript-eslint/scope-manager" "4.8.1"
|
||||
"@typescript-eslint/types" "4.8.1"
|
||||
"@typescript-eslint/typescript-estree" "4.8.1"
|
||||
debug "^4.1.1"
|
||||
|
||||
"@typescript-eslint/scope-manager@4.3.0":
|
||||
version "4.3.0"
|
||||
|
@ -6106,29 +6102,23 @@
|
|||
"@typescript-eslint/types" "4.3.0"
|
||||
"@typescript-eslint/visitor-keys" "4.3.0"
|
||||
|
||||
"@typescript-eslint/types@3.10.0":
|
||||
version "3.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.0.tgz#b81906674eca94a884345ba0bc1aaf6cd4da912a"
|
||||
integrity sha512-ktUWSa75heQNwH85GRM7qP/UUrXqx9d6yIdw0iLO9/uE1LILW+i+3+B64dUodUS2WFWLzKTlwfi9giqrODibWg==
|
||||
"@typescript-eslint/scope-manager@4.8.1":
|
||||
version "4.8.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.8.1.tgz#e343c475f8f1d15801b546cb17d7f309b768fdce"
|
||||
integrity sha512-r0iUOc41KFFbZdPAdCS4K1mXivnSZqXS5D9oW+iykQsRlTbQRfuFRSW20xKDdYiaCoH+SkSLeIF484g3kWzwOQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.8.1"
|
||||
"@typescript-eslint/visitor-keys" "4.8.1"
|
||||
|
||||
"@typescript-eslint/types@4.3.0":
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.3.0.tgz#1f0b2d5e140543e2614f06d48fb3ae95193c6ddf"
|
||||
integrity sha512-Cx9TpRvlRjOppGsU6Y6KcJnUDOelja2NNCX6AZwtVHRzaJkdytJWMuYiqi8mS35MRNA3cJSwDzXePfmhU6TANw==
|
||||
|
||||
"@typescript-eslint/typescript-estree@3.10.0":
|
||||
version "3.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.0.tgz#65df13579a5e53c12afb4f1c5309589e3855a5de"
|
||||
integrity sha512-yjuY6rmVHRhcUKgXaSPNVloRueGWpFNhxR5EQLzxXfiFSl1U/+FBqHhbaGwtPPEgCSt61QNhZgiFjWT27bgAyw==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "3.10.0"
|
||||
"@typescript-eslint/visitor-keys" "3.10.0"
|
||||
debug "^4.1.1"
|
||||
glob "^7.1.6"
|
||||
is-glob "^4.0.1"
|
||||
lodash "^4.17.15"
|
||||
semver "^7.3.2"
|
||||
tsutils "^3.17.1"
|
||||
"@typescript-eslint/types@4.8.1":
|
||||
version "4.8.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.8.1.tgz#23829c73c5fc6f4fcd5346a7780b274f72fee222"
|
||||
integrity sha512-ave2a18x2Y25q5K05K/U3JQIe2Av4+TNi/2YuzyaXLAsDx6UZkz1boZ7nR/N6Wwae2PpudTZmHFXqu7faXfHmA==
|
||||
|
||||
"@typescript-eslint/typescript-estree@4.3.0":
|
||||
version "4.3.0"
|
||||
|
@ -6144,6 +6134,20 @@
|
|||
semver "^7.3.2"
|
||||
tsutils "^3.17.1"
|
||||
|
||||
"@typescript-eslint/typescript-estree@4.8.1":
|
||||
version "4.8.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.8.1.tgz#7307e3f2c9e95df7daa8dc0a34b8c43b7ec0dd32"
|
||||
integrity sha512-bJ6Fn/6tW2g7WIkCWh3QRlaSU7CdUUK52shx36/J7T5oTQzANvi6raoTsbwGM11+7eBbeem8hCCKbyvAc0X3sQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.8.1"
|
||||
"@typescript-eslint/visitor-keys" "4.8.1"
|
||||
debug "^4.1.1"
|
||||
globby "^11.0.1"
|
||||
is-glob "^4.0.1"
|
||||
lodash "^4.17.15"
|
||||
semver "^7.3.2"
|
||||
tsutils "^3.17.1"
|
||||
|
||||
"@typescript-eslint/typescript-estree@^1.9.0":
|
||||
version "1.9.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.9.0.tgz#5d6d49be936e96fb0f859673480f89b070a5dd9b"
|
||||
|
@ -6152,13 +6156,6 @@
|
|||
lodash.unescape "4.0.1"
|
||||
semver "5.5.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@3.10.0":
|
||||
version "3.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.0.tgz#6c0cac867e705a42e2c71b359bf6a10a88a28985"
|
||||
integrity sha512-g4qftk8lWb/rHZe9uEp8oZSvsJhUvR2cfp7F7qE6DyUD2SsovEs8JDQTRP1xHzsD+pERsEpYNqkDgQXW6+ob5A==
|
||||
dependencies:
|
||||
eslint-visitor-keys "^1.1.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@4.3.0":
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.3.0.tgz#0e5ab0a09552903edeae205982e8521e17635ae0"
|
||||
|
@ -6167,6 +6164,14 @@
|
|||
"@typescript-eslint/types" "4.3.0"
|
||||
eslint-visitor-keys "^2.0.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@4.8.1":
|
||||
version "4.8.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.8.1.tgz#794f68ee292d1b2e3aa9690ebedfcb3a8c90e3c3"
|
||||
integrity sha512-3nrwXFdEYALQh/zW8rFwP4QltqsanCDz4CwWMPiIZmwlk9GlvBeueEIbq05SEq4ganqM0g9nh02xXgv5XI3PeQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.8.1"
|
||||
eslint-visitor-keys "^2.0.0"
|
||||
|
||||
"@webassemblyjs/ast@1.9.0":
|
||||
version "1.9.0"
|
||||
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964"
|
||||
|
@ -12935,10 +12940,10 @@ eslint-plugin-prettier@^3.1.4:
|
|||
dependencies:
|
||||
prettier-linter-helpers "^1.0.0"
|
||||
|
||||
eslint-plugin-react-hooks@^4.0.4:
|
||||
version "4.0.4"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.0.4.tgz#aed33b4254a41b045818cacb047b81e6df27fa58"
|
||||
integrity sha512-equAdEIsUETLFNCmmCkiCGq6rkSK5MoJhXFPFYeUebcjKgBmWWcgVOqZyQC8Bv1BwVCnTq9tBxgJFgAJTWoJtA==
|
||||
eslint-plugin-react-hooks@^4.2.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556"
|
||||
integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==
|
||||
|
||||
eslint-plugin-react-perf@^3.2.3:
|
||||
version "3.2.3"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue