Skip to content

Commit

Permalink
Fix linting problems
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallmain committed Dec 12, 2024
1 parent 259f81f commit 64d693e
Show file tree
Hide file tree
Showing 30 changed files with 33 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import React from 'react';
import { useCallback, useMemo, useState } from 'react';
import React, { useCallback, useMemo, useState } from 'react';
import {
EuiComboBoxOptionOption,
EuiIcon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { getGenericComboBoxProps } from '../get_generic_combo_box_props';

// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715
// import { HttpStart } from '@kbn/core/public';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type HttpStart = any;

import * as i18n from '../translations';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-

// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715
// import { AutocompleteStart } from '../../../../../../../../../../src/plugins/unified_search/public';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AutocompleteStart = any;

import * as i18n from '../translations';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { DataViewBase, DataViewFieldBase } from '@kbn/es-query';

// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715
// import { AutocompleteStart } from '../../../../../../../../../../src/plugins/unified_search/public';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AutocompleteStart = any;

import * as i18n from '../translations';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-

// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715
// import { AutocompleteStart } from '../../../../../../../../../../src/plugins/unified_search/public';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AutocompleteStart = any;

import * as i18n from '../translations';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { DataViewBase, DataViewFieldBase, getDataViewFieldSubtypeNested } from '

// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715
// import { AutocompleteStart } from '../../../../../../../../../../../src/plugins/unified_search/public';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AutocompleteStart = any;

interface FuncArgs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

require('../../../../../../src/setup_node_env');
// eslint-disable-next-line import/no-nodejs-modules
const { join, resolve } = require('path');
const { bundle } = require('@kbn/openapi-bundler');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

require('../../../../../../src/setup_node_env');
// eslint-disable-next-line import/no-nodejs-modules
const { join, resolve } = require('path');
const { generate } = require('@kbn/openapi-generator');
const { REPO_ROOT } = require('@kbn/repo-info');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('OsCondition', () => {
expect(wrapper.container).toMatchSnapshot();
});
it('should return any os sent', () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const wrapper = render(<OsCondition os={['MacPro' as any]} dataTestSubj="OsConditionMac" />);
expect(wrapper.getByTestId('osLabel')).toHaveTextContent(i18n.CONDITION_OS);
expect(wrapper.getByTestId('osValue')).toHaveTextContent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('MetaInfoDetails', () => {
<MetaInfoDetails
dataTestSubj="MetaInfoDetails"
label="created_by"
// eslint-disable-next-line react/jsx-no-literals
lastUpdate={<p>Last update value</p>}
lastUpdateValue="value"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
*/

import { render } from '@testing-library/react';
import { ReactElement } from 'react';
import { ElementType } from 'react';
import { ReactElement, ElementType } from 'react';
import { generateLinkedRulesMenuItems } from '.';
import { rules } from '../mocks/rule_references.mock';
import {
Expand Down Expand Up @@ -45,7 +44,7 @@ describe('generateLinedRulesMenuItems', () => {
leftIcon: 'check',
}) as ReactElement[];

result.map((link) => {
result.forEach((link) => {
const wrapper = render(link);
expect(wrapper.container).toMatchSnapshot();
expect(wrapper.getByTestId('generateLinedRulesMenuItemsTestActionItem1a2b3c'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
/* eslint-disable react/jsx-no-literals */

import React from 'react';
import type { FC } from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('TextWithEdit', () => {
isReadonly={false}
dataTestSubj="TextWithEditTest"
text="Test"
// eslint-disable-next-line @typescript-eslint/no-explicit-any
onEdit={onEdit as any}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

require('../../../../../../src/setup_node_env');
// eslint-disable-next-line import/no-nodejs-modules
const { join, resolve } = require('path');
const { bundle } = require('@kbn/openapi-bundler');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

require('../../../../../../src/setup_node_env');
// eslint-disable-next-line import/no-nodejs-modules
const { join, resolve } = require('path');
const { generate } = require('@kbn/openapi-generator');
const { REPO_ROOT } = require('@kbn/repo-info');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { exactCheck } from '@kbn/securitysolution-io-ts-utils';
import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils';
import { maxSizeOrUndefined } from '.';

import { pipe } from 'fp-ts/lib/pipeable';
import { left } from 'fp-ts/lib/Either';

import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils';

describe('maxSizeOrUndefined', () => {
test('it will validate a correct max value', () => {
const payload = 123;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { exactCheck } from '@kbn/securitysolution-io-ts-utils';
import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils';
import { osType, osTypeArrayOrUndefined } from '.';

import { pipe } from 'fp-ts/lib/pipeable';
import { left } from 'fp-ts/lib/Either';

import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils';

describe('osType', () => {
test('it will validate a correct osType', () => {
const payload = 'windows';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { exactCheck } from '@kbn/securitysolution-io-ts-utils';
import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils';
import { pitOrUndefined } from '.';

import * as t from 'io-ts';
import { pipe } from 'fp-ts/lib/pipeable';
import { left } from 'fp-ts/lib/Either';

import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils';

describe('pitOrUndefined', () => {
test('it will validate a correct pit', () => {
const payload = { id: '123', keepAlive: '1m' };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { exactCheck } from '@kbn/securitysolution-io-ts-utils';
import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils';
import { searchOrUndefined } from '.';

import * as t from 'io-ts';
import { pipe } from 'fp-ts/lib/pipeable';
import { left } from 'fp-ts/lib/Either';

import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils';

describe('search', () => {
test('it will validate a correct search', () => {
const payload = 'name:foo';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { exactCheck } from '@kbn/securitysolution-io-ts-utils';
import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils';
import { searchAfterOrUndefined } from '.';

import * as t from 'io-ts';
import { pipe } from 'fp-ts/lib/pipeable';
import { left } from 'fp-ts/lib/Either';

import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils';

describe('searchAfter', () => {
test('it will validate a correct search_after', () => {
const payload = ['test-1', 'test-2'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ import { DefaultCreateCommentsArray } from '../../common/default_create_comments
import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type';
import { RequiredKeepUndefined } from '../../common/required_keep_undefined';
import { CreateCommentsArray } from '../../common/create_comment';
import { Tags } from '../../common/tags';
import { Tags, tags } from '../../common/tags';
import { ItemId } from '../../common/item_id';
import { EntriesArray } from '../../common/entries';
import { description } from '../../common/description';
import { name } from '../../common/name';
import { meta } from '../../common/meta';
import { tags } from '../../common/tags';

export const createEndpointListItemSchema = t.intersection([
t.exact(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { DefaultUuid } from '@kbn/securitysolution-io-ts-types';

import { DefaultCreateCommentsArray } from '../../common/default_create_comments_array';
import { CreateCommentsArray } from '../../common/create_comment';
import { Tags } from '../../common/tags';
import { Tags, tags } from '../../common/tags';
import { ItemId } from '../../common/item_id';
import { EntriesArray } from '../../common/entries';
import { NamespaceType } from '../../common/default_namespace';
Expand All @@ -24,7 +24,6 @@ import { name } from '../../common/name';
import { exceptionListItemType } from '../../common/exception_list_item_type';
import { meta } from '../../common/meta';
import { namespace_type } from '../../common/namespace_type';
import { tags } from '../../common/tags';
import { nonEmptyEntriesArray } from '../../common/non_empty_entries_array';
import { ExpireTimeOrUndefined, expireTimeOrUndefined } from '../../common';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ import {
import { exceptionListType } from '../../common/exception_list';
import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type';
import { RequiredKeepUndefined } from '../../common/required_keep_undefined';
import { Tags } from '../../common/tags';
import { Tags, tags } from '../../common/tags';
import { ListId } from '../../common/list_id';
import { NamespaceType } from '../../common/default_namespace';
import { name } from '../../common/name';
import { description } from '../../common/description';
import { namespace_type } from '../../common/namespace_type';
import { tags } from '../../common/tags';
import { meta } from '../../common/meta';

export const createExceptionListSchema = t.intersection([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
import * as t from 'io-ts';

import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type';
import { Tags } from '../../common/tags';
import { Tags, tags } from '../../common/tags';
import { NamespaceType } from '../../common/default_namespace';
import { name } from '../../common/name';
import { description } from '../../common/description';
import { namespace_type } from '../../common/namespace_type';
import { tags } from '../../common/tags';
import { meta } from '../../common/meta';
import { list_id } from '../../common/list_id';
import { item_id } from '../../common/item_id';
import { item_id, ItemId } from '../../common/item_id';
import { id } from '../../common/id';
import { created_at } from '../../common/created_at';
import { created_by } from '../../common/created_by';
Expand All @@ -28,7 +27,6 @@ import { _version } from '../../common/underscore_version';
import { tie_breaker_id } from '../../common/tie_breaker_id';
import { nonEmptyEntriesArray } from '../../common/non_empty_entries_array';
import { exceptionListItemType } from '../../common/exception_list_item_type';
import { ItemId } from '../../common/item_id';
import { EntriesArray } from '../../common/entries';
import { DefaultImportCommentsArray } from '../../common/default_import_comments_array';
import { ExpireTimeOrUndefined, expireTimeOrUndefined, ImportCommentsArray } from '../../common';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ import {

import { exceptionListType } from '../../common/exception_list';
import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type';
import { Tags } from '../../common/tags';
import { ListId } from '../../common/list_id';
import { Tags, tags } from '../../common/tags';
import { ListId, list_id } from '../../common/list_id';
import { NamespaceType } from '../../common/default_namespace';
import { name } from '../../common/name';
import { description } from '../../common/description';
import { namespace_type } from '../../common/namespace_type';
import { tags } from '../../common/tags';
import { meta } from '../../common/meta';
import { list_id } from '../../common/list_id';
import { id } from '../../common/id';
import { created_at } from '../../common/created_at';
import { created_by } from '../../common/created_by';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type {
// These originally came from this location below before moving them to this hacked "any" types:
// import { HttpStart, NotificationsStart } from '../../../../../../../../src/core/public';
interface HttpStart {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fetch: <T>(...args: any) => any;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,7 @@ export const hasWrongOperatorWithWildcard = (
return item;
});

// eslint-disable-next-line array-callback-return
return allEntries.some((e) => {
if (e.type !== 'list' && 'value' in e) {
return validateHasWildcardWithWrongOperator({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

require('../../../../../../src/setup_node_env');
// eslint-disable-next-line import/no-nodejs-modules
const { join, resolve } = require('path');
const { bundle } = require('@kbn/openapi-bundler');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

require('../../../../../../src/setup_node_env');
// eslint-disable-next-line import/no-nodejs-modules
const { join, resolve } = require('path');
const { generate } = require('@kbn/openapi-generator');
const { REPO_ROOT } = require('@kbn/repo-info');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class FormattedAxiosError extends Error {
public readonly response: {
status: number;
statusText: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
data: any;
};

Expand Down

0 comments on commit 64d693e

Please sign in to comment.