Skip to content

Commit e4917a6

Browse files
authored
[chore] Update eslint and fix newly-generated warnings (#1394)
Summary: Changes to eslint also changed how a couple of the rules behave. Type of change: /kind cleanup Test Plan: `yarn install && yarn lint`. Signed-off-by: Nick Lanam <nlanam@pixielabs.ai>
1 parent 91878ed commit e4917a6

File tree

16 files changed

+910
-508
lines changed

16 files changed

+910
-508
lines changed

src/ui/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"@types/react-table": "^7.7.1",
2828
"@types/react-window": "^1.8.3",
2929
"@types/segment-analytics": "^0.0.32",
30-
"@typescript-eslint/eslint-plugin": "^5.9.1",
31-
"@typescript-eslint/parser": "^5.9.1",
30+
"@typescript-eslint/eslint-plugin": "^5.59.8",
31+
"@typescript-eslint/parser": "^5.59.8",
3232
"@welldone-software/why-did-you-render": "^4.3.1",
3333
"@yarnpkg/pnpify": "^3.1.0",
3434
"archiver": "^5.0.2",
@@ -42,15 +42,15 @@
4242
"esbuild": "^0.13.13",
4343
"esbuild-jest": "^0.5.0",
4444
"esbuild-loader": "^2.16.0",
45-
"eslint": "^8.6.0",
45+
"eslint": "^8.41.0",
4646
"eslint-config-airbnb-typescript": "^16.1.0",
4747
"eslint-import-resolver-node": "^0.3.6",
48-
"eslint-import-resolver-typescript": "^2.5.0",
48+
"eslint-import-resolver-typescript": "^3.5.5",
4949
"eslint-plugin-cypress": "^2.12.1",
50-
"eslint-plugin-import": "^2.25.4",
51-
"eslint-plugin-jest": "^25.3.4",
52-
"eslint-plugin-react": "^7.30.0",
53-
"eslint-plugin-react-hooks": "^4.5.0",
50+
"eslint-plugin-import": "^2.27.5",
51+
"eslint-plugin-jest": "^27.2.1",
52+
"eslint-plugin-react": "^7.32.2",
53+
"eslint-plugin-react-hooks": "^4.6.0",
5454
"eslint-plugin-react-memo": "^0.0.3",
5555
"favicons": "^7.1.2",
5656
"favicons-webpack-plugin": "^6.0.0",
@@ -158,7 +158,7 @@
158158
"coverage": "jest --coverage",
159159
"coverage_ci": "jest --coverage --maxWorkers=4",
160160
"license_check": "yarn pnpify license-checker --relativeLicensePath",
161-
"lint": "tsc --noEmit && eslint -c .eslintrc.json .",
161+
"lint": "yarn typecheck && eslint -c .eslintrc.json .",
162162
"cypress:open": "cypress open",
163163
"cypress:run": "cypress run"
164164
},

src/ui/src/api/api-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { switchMap } from 'rxjs/operators';
2525
import { Status } from 'app/types/generated/vizierapi_pb';
2626
import { containsMutation } from 'app/utils/pxl';
2727

28-
import { GetCSRFCookie } from '../pages/auth/utils';
2928
import { PixieAPIClientOptions } from './api-options';
3029
import { CloudClient } from './cloud-gql-client';
3130
import { VizierQueryError } from './vizier';
@@ -35,6 +34,7 @@ import {
3534
VizierQueryFunc,
3635
ExecuteScriptOptions,
3736
} from './vizier-grpc-client';
37+
import { GetCSRFCookie } from '../pages/auth/utils';
3838

3939
/**
4040
* When calling `PixieAPIClient.create`, this specifies which clusters to connect to, and any special configuration for

src/ui/src/api/cloud-gql-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ import fetch from 'cross-fetch';
3333

3434
import { isPixieEmbedded } from 'app/common/embed-context';
3535

36-
import { GetCSRFCookie } from '../pages/auth/utils';
3736
import { PixieAPIClientOptions } from './api-options';
37+
import { GetCSRFCookie } from '../pages/auth/utils';
3838

3939
// Apollo link that adds cookies in the request.
4040
const makeCloudAuthLink = (opts: PixieAPIClientOptions) => setContext((_, { headers }) => ({

src/ui/src/components/auth/pixienaut-octopus.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import React from 'react';
2020

2121
// eslint-disable-next-line react-memo/require-memo,react/display-name
2222
export const PixienautOctopusSvg: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
23-
/* eslint-disable max-len */
23+
/* eslint-disable max-len,react/no-unknown-property */
2424
<svg {...props} width='3681' height='1684' viewBox='0 0 3681 1684' fill='none' xmlns='http://www.w3.org/2000/svg'>
2525
<path
2626
d='M255.23 1413.48C255.23 1413.48 375.911 1507.73 471.019 1497.44C566.699 1487.09 623.566 1429.79 603.898 1377.1C584.23 1324.4 492.114 1378.5 459.752 1354.9C427.39 1331.27 413.834 1311.11 413.834 1311.11L255.23 1413.48Z'

src/ui/src/components/auth/pixienaut-toilet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import React from 'react';
2020

2121
// eslint-disable-next-line react-memo/require-memo,react/display-name
2222
export const PixienautToiletSvg: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
23-
/* eslint-disable max-len */
23+
/* eslint-disable max-len,react/no-unknown-property */
2424
<svg {...props} width='882' height='1045' viewBox='0 0 882 1045' fill='none' xmlns='http://www.w3.org/2000/svg'>
2525
<path
2626
d='M184.025 691.843L275.173 695.709C294.849 696.544 304.686 696.961 312.753 700.741C319.769 704.028 325.802 709.094 330.256 715.434C335.376 722.724 337.491 732.34 341.721 751.574L341.721 751.574C348.015 780.193 351.163 794.503 345.206 807.858C340.886 817.545 328.496 828.707 318.412 831.996C304.51 836.531 294.116 833.079 273.33 826.174C222.881 809.417 184.025 771.539 184.025 691.843Z'

src/ui/src/components/command-palette/providers/script/missing-script-provider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import { checkExhaustive } from 'app/utils/check-exhaustive';
3535
import { Script } from 'app/utils/script-bundle';
3636
import { highlightNamespacedScoredMatch, highlightScoredMatch } from 'app/utils/string-search';
3737

38-
import { CommandPaletteContext } from '../../command-palette-context';
3938
import {
4039
CompletionDescription,
4140
CompletionLabel,
@@ -48,12 +47,13 @@ import {
4847
getFullScriptSuggestions,
4948
getSuggestedArgsFromPossibleEntity,
5049
} from './script-suggestions';
50+
import { CommandPaletteContext } from '../../command-palette-context';
5151

5252
type DecoratedCompletion = CommandCompletion & { forScript: string };
5353

5454
const DEFAULT: CommandProviderState = Object.freeze({
5555
input: '',
56-
selection: [0, 0],
56+
selection: [0, 0] as [start: number, end: number],
5757
providerName: 'MissingScriptProvider',
5858
loading: false,
5959
completions: [],

src/ui/src/components/command-palette/providers/script/script-provider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import { CancellablePromise, makeCancellable } from 'app/utils/cancellable-promi
3737
import { checkExhaustive } from 'app/utils/check-exhaustive';
3838
import { Script } from 'app/utils/script-bundle';
3939

40-
import { CommandPaletteContext } from '../../command-palette-context';
4140
import {
4241
CompletionLabel,
4342
getFieldSuggestions,
@@ -50,10 +49,11 @@ import {
5049
getScriptArgSuggestions,
5150
getScriptArgValueSuggestions,
5251
} from './script-suggestions';
52+
import { CommandPaletteContext } from '../../command-palette-context';
5353

5454
const DEFAULT: CommandProviderState = Object.freeze({
5555
input: '',
56-
selection: [0, 0],
56+
selection: [0, 0] as [start: number, end: number],
5757
providerName: 'ScriptProvider',
5858
loading: false,
5959
completions: [],

src/ui/src/containers/live-data-table/live-data-table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const DataAlignmentMap = new Map<DataType, CellAlignment>(
5757

5858
export type CompleteColumnDef =
5959
ReactTableColumn<Record<string, any>>
60-
& { Cell: ({ value: any }) => (JSX.Element | null) };
60+
& { Cell: ({ value }: { value: any }) => (JSX.Element | null) };
6161

6262
/** Transforms a table coming from a script into something react-table understands. */
6363
function useConvertedTable(

src/ui/src/containers/live-widgets/graph/graph.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ import { Relation, SemanticType } from 'app/types/generated/vizierapi_pb';
3636
import { Arguments } from 'app/utils/args-utils';
3737
import { GaugeLevel, getColor, getLatencyNSLevel } from 'app/utils/metric-thresholds';
3838

39-
import { formatByDataType, formatBySemType } from '../../format-data/format-data';
40-
import { deepLinkURLFromSemanticType } from '../utils/live-view-params';
4139
import { GraphBase } from './graph-base';
4240
import {
4341
ColInfo,
4442
colInfoFromName,
4543
getGraphOptions,
4644
semTypeToShapeConfig,
4745
} from './graph-utils';
46+
import { formatByDataType, formatBySemType } from '../../format-data/format-data';
47+
import { deepLinkURLFromSemanticType } from '../utils/live-view-params';
4848

4949
interface AdjacencyList {
5050
toColumn: string;

src/ui/src/containers/live-widgets/graph/request-graph-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import { data as visData } from 'vis-network/standalone';
2020

2121
import { dataWithUnitsToString, formatBySemType } from 'app/containers/format-data/format-data';
22-
import { deepLinkURLFromSemanticType, EmbedState } from 'app/containers/live-widgets/utils/live-view-params';
2322
import { WidgetDisplay } from 'app/containers/live/vis';
23+
import { deepLinkURLFromSemanticType, EmbedState } from 'app/containers/live-widgets/utils/live-view-params';
2424
import { Relation, SemanticType } from 'app/types/generated/vizierapi_pb';
2525
import { Arguments } from 'app/utils/args-utils';
2626
import { formatFloat64Data } from 'app/utils/format-data';

0 commit comments

Comments
 (0)