Skip to content

Commit

Permalink
fix lint issues: no-extraneous-dependencies & no-unused-vars
Browse files Browse the repository at this point in the history
Signed-off-by: Alfonso Martínez <[email protected]>
  • Loading branch information
alfonsomthd committed Oct 6, 2022
1 parent 63558e4 commit bec76eb
Show file tree
Hide file tree
Showing 98 changed files with 97 additions and 106 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ module.exports = {
'default-case': 'off',
'global-require': 'off',
'implicit-arrow-linebreak': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-extraneous-dependencies': [
'error',
{ packageDir: ['.', './packages/odf'] },
],
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/label-has-associated-control': 'off',
Expand Down Expand Up @@ -92,7 +95,7 @@ module.exports = {
'react/no-unused-state': 'off',
'react/sort-comp': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'react/function-component-definition': [
2,
{
Expand Down
2 changes: 1 addition & 1 deletion cypress/helpers/add-capacity.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from 'lodash';
import * as _ from 'lodash-es';

export const createOSDTreeMap = (nodes) =>
nodes.reduce((acc, curr) => Object.assign(acc, { [curr.id]: curr }), {});
Expand Down
2 changes: 1 addition & 1 deletion cypress/tests/add-capacity.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
CLUSTER_STATUS,
STORAGE_SYSTEM_NAME,
Expand Down
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,16 @@
"@patternfly/react-core": "4.175.4",
"@patternfly/react-icons": "^4.11.0",
"@patternfly/react-table": "4.104.7",
"@patternfly/react-tokens": "^4.12.0",
"@types/react-dnd-html5-backend": "^3.0.2",
"classnames": "^2.3.1",
"eslint-config-airbnb": "18.2.1",
"fuzzysearch": "^1.0.3",
"history": "^4.9.0",
"i18next": "^20.2.1",
"i18next-conv": "^10.1.0",
"js-base64": "^2.1.9",
"js-yaml": "^3.13.1",
"lodash-es": "^4.17.21",
"murmurhash-js": "^1.0.0",
"react": "^17.0.1",
Expand All @@ -69,7 +74,9 @@
"react-redux": "^7.2.6",
"react-router": "5.2.0",
"react-router-dom": "5.2.0",
"react-tagsinput": "^3.19.0"
"react-tagsinput": "^3.19.0",
"redux": "^4.0.0",
"victory-core": "^35.4.4"
},
"devDependencies": {
"@cypress/webpack-preprocessor": "^5.9.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type DataPoliciesListProps = {
history: RouteComponentProps['history'];
};

export const DataPoliciesList: React.FC<DataPoliciesListProps> = (props) => {
export const DataPoliciesList: React.FC<DataPoliciesListProps> = () => {
const { t } = useCustomTranslation();
const title = t('Data policies');
const pages = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
StatusIconAndText,
} from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
Flex,
FlexItem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
k8sPatch,
useK8sWatchResource,
} from '@openshift-console/dynamic-plugin-sdk';
import * as _ from 'lodash';
import { RouteComponentProps, match as Match } from 'react-router';
import {
Form,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { isMinimumSupportedODFVersion } from '@odf/mco/utils';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { referenceForModel } from '@odf/shared/utils';
import { useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk';
import * as _ from 'lodash';
import {
DataList,
DataListItem,
Expand Down Expand Up @@ -233,7 +232,7 @@ export const SelectClusterList: React.FC<SelectClusterListProps> = ({
placeholder={t('Cluster name')}
onChange={(val) => setNameSearch(val)}
value={nameSearch}
onClear={(e) => setNameSearch('')}
onClear={() => setNameSearch('')}
/>
</ToolbarItem>
</ToolbarContent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import * as _ from 'lodash';
import {
Text,
Badge,
Expand All @@ -20,7 +19,7 @@ type SelectedClusterProps = {
export const SelectedCluster: React.FC<SelectedClusterProps> = ({
id,
cluster,
dispatch,
dispatch, // eslint-disable-line @typescript-eslint/no-unused-vars
}) => {
const { name, region, storageSystemName } = cluster;
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
TableColumn,
} from '@openshift-console/dynamic-plugin-sdk';
import classNames from 'classnames';
import * as _ from 'lodash';
import { Trans } from 'react-i18next';
import { useHistory } from 'react-router';
import { sortable, wrappable } from '@patternfly/react-table';
Expand Down
2 changes: 1 addition & 1 deletion packages/mco/components/mco-dashboard/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const MCODashboard: React.FC = () => {
);
};

const MCODashboardPage: React.FC<MCODashboardPageProps> = (props) => {
const MCODashboardPage: React.FC<MCODashboardPageProps> = () => {
const { t } = useCustomTranslation();
const title = t('Storage System');
const pages = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
PrometheusResponse,
} from '@openshift-console/dynamic-plugin-sdk';
import { HealthBody } from '@openshift-console/dynamic-plugin-sdk-internal';
import * as _ from 'lodash';
import {
Flex,
FlexItem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from '@openshift-console/dynamic-plugin-sdk';
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
import { TFunction } from 'i18next';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
Progress,
ProgressMeasureLocation,
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/block-pool/body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@odf/shared/types';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { useFlag } from '@openshift-console/dynamic-plugin-sdk';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
Alert,
Dropdown,
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/dashboards/block-pool/mirroring-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { StatusIconAndText } from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import { Trans } from 'react-i18next';
import { ChartPie, ChartThemeColor } from '@patternfly/react-charts';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
useFlag,
} from '@openshift-console/dynamic-plugin-sdk';
import { K8sModel } from '@openshift-console/dynamic-plugin-sdk/lib/api/common-types';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
Select,
SelectGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
PrometheusResponse,
} from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import * as _ from 'lodash';
import * as _ from 'lodash-es';

export const DataConsumersValue = {
[Breakdown.PROVIDERS]: 'PROVIDERS_',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
PrometheusResponse,
useFlag,
} from '@openshift-console/dynamic-plugin-sdk';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core';
import { DataConsumptionDropdown } from './data-consumption-card-dropdown';
import DataConsumptionGraph from './data-consumption-graph';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DATA_CONSUMPTION_QUERIES } from '@odf/ocs/queries';
import { GraphEmpty } from '@odf/shared/charts';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { PrometheusResponse } from '@openshift-console/dynamic-plugin-sdk';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
Chart,
ChartAxis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { DataPoint } from '@odf/shared/utils';
import { humanizeDecimalBytesPerSec, humanizeSeconds } from '@odf/shared/utils';
import classNames from 'classnames';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
Chart,
ChartVoronoiContainer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
} from '@openshift-console/dynamic-plugin-sdk';
import { DetailsBody } from '@openshift-console/dynamic-plugin-sdk-internal';
import { OverviewDetailItem as DetailItem } from '@openshift-console/plugin-shared';
import * as _ from 'lodash';
import { Link } from 'react-router-dom';
import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core';
import { getOCSVersion } from '../../../utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { RedExclamationCircleIcon } from '@odf/shared/status/icons';
import * as _ from 'lodash';
import * as _ from 'lodash-es';

const ResourceProvidersItemStatus: React.FC<ResourceProvidersRowStatusProps> =
// eslint-disable-next-line react/display-name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { getMetric } from '@odf/shared/utils';
import { PrometheusResponse } from '@openshift-console/dynamic-plugin-sdk';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core';
import { ResourceProvidersBody } from './resource-providers-card-body';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
HealthBody,
} from '@openshift-console/dynamic-plugin-sdk-internal';
import { SubsystemHealth } from '@openshift-console/dynamic-plugin-sdk/lib/extensions/dashboard-types';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
Gallery,
GalleryItem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
RecentEventsBody,
} from '@openshift-console/dynamic-plugin-sdk-internal';
import { EventKind } from '@openshift-console/dynamic-plugin-sdk/lib/api/internal-types';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import { Card, CardHeader, CardTitle } from '@patternfly/react-core';
import { OCS_OPERATOR, PVC_PROVISIONER_ANNOTATION } from '../../../constants';
import { StorageClusterModel } from '../../../models';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
HealthItem,
} from '@openshift-console/dynamic-plugin-sdk-internal';
import { SubsystemHealth } from '@openshift-console/dynamic-plugin-sdk/lib/extensions/dashboard-types';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
Gallery,
GalleryItem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from '@odf/shared/hooks/custom-prometheus-poll';
import { Humanize } from '@openshift-console/dynamic-plugin-sdk';
import { useUtilizationDuration } from '@openshift-console/dynamic-plugin-sdk-internal';
import * as _ from 'lodash';
import { MultilineUtilizationItem } from './multi-utilization-item';

export const PrometheusMultilineUtilizationItem: React.FC<PrometheusMultilineUtilizationItemProps> =
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/queries/object-storage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NooBaaBucketClassModel } from '@odf/core/models';
import { ProjectModel } from '@odf/shared/models';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
CapacityBreakdown,
ServiceType,
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/storage-class/sc-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import {
useK8sWatchResource,
useModal,
} from '@openshift-console/dynamic-plugin-sdk';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
Alert,
Dropdown,
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@odf/shared/types';
import { DataPoint, humanizePercentage } from '@odf/shared/utils';
import { EventKind } from '@openshift-console/dynamic-plugin-sdk-internal/lib/api/internal-types';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import { cephStorageLabel, CEPH_NS } from '../constants';

const OCS_OPERATOR = 'ocs-operator';
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/utils/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
PrometheusRule,
Rule,
} from '@openshift-console/dynamic-plugin-sdk';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import { murmur3 } from 'murmurhash-js';

export const getStackChartStats: GetStackStats = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { TimeUnits } from '../../constants';

export const TimeDurationDropdown: React.FC<TimeDurationDropdownProps> = ({
id,
id, // eslint-disable-line @typescript-eslint/no-unused-vars
inputClassName,
onChange,
required,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { SingleSelectDropdown } from '@odf/shared/dropdown/singleselectdropdown'
import { NodeKind } from '@odf/shared/types';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { TFunction } from 'i18next';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import { SelectOption } from '@patternfly/react-core';
import {
FormGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { NodeKind } from '@odf/shared/types';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { convertToBaseValue, humanizeBinaryBytes } from '@odf/shared/utils';
import { useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import { ChartDonut, ChartLabel } from '@patternfly/react-charts';
import { Button } from '@patternfly/react-core';
import { WizardState, WizardDispatch } from '../../reducer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { BackingStorageType, DeploymentType } from '@odf/core/types';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { humanizeBinaryBytes } from '@odf/shared/utils';
import { useFlag } from '@openshift-console/dynamic-plugin-sdk';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
TextContent,
Text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export const EncryptionForm: React.FC<EncryptionProps> = ({
kms,
dispatch,
infraType,
isMCG,
isMCG, // eslint-disable-line @typescript-eslint/no-unused-vars
}) => {
// enclosed in a "Form" so that child components can use default pf classes
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { ListKind, PodKind } from '@odf/shared/types';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { getAPIVersionForModel } from '@odf/shared/utils';
import { K8sKind } from '@openshift-console/dynamic-plugin-sdk/lib/api/common-types';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import { Trans } from 'react-i18next';
import {
FormGroup,
Expand Down
2 changes: 1 addition & 1 deletion packages/odf/components/create-storage-system/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TextVariants, Text, TextContent } from '@patternfly/react-core';
import './create-storage-system.scss';

export const CreateStorageSystemHeader: React.FC<CreateStorageSystemHeaderProps> =
({ url }) => {
() => {
const { t } = useCustomTranslation();
return (
<div className="odf-create-storage-system__header">
Expand Down
2 changes: 1 addition & 1 deletion packages/odf/components/create-storage-system/payloads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { K8sResourceKind, Patch, StorageSystemKind } from '@odf/shared/types';
import { getAPIVersionForModel, k8sPatchByName } from '@odf/shared/utils';
import { k8sCreate, k8sGet } from '@openshift-console/dynamic-plugin-sdk';
import { K8sKind } from '@openshift-console/dynamic-plugin-sdk/lib/api/common-types';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
ocsTaint,
defaultRequestSize,
Expand Down
2 changes: 1 addition & 1 deletion packages/odf/components/create-storage-system/reducer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodeKind } from '@odf/shared/types';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import {
KMSEmptyState,
NO_PROVISIONER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
useListPageFilter,
} from '@openshift-console/dynamic-plugin-sdk';
import classNames from 'classnames';
import * as _ from 'lodash';
import * as _ from 'lodash-es';
import { Table, TableHeader, TableBody } from '@patternfly/react-table';
import { IRow, sortable } from '@patternfly/react-table';
import { WizardNodeState } from '../reducer';
Expand Down
Loading

0 comments on commit bec76eb

Please sign in to comment.