update typescript-eslint

This commit is contained in:
Aleksandra Sikora 2020-08-06 12:33:43 +02:00
parent add325934d
commit 0becc4f3e2
19 changed files with 116 additions and 45 deletions

View File

@ -3627,22 +3627,67 @@
}
},
"@typescript-eslint/eslint-plugin": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.24.0.tgz",
"integrity": "sha512-wJRBeaMeT7RLQ27UQkDFOu25MqFOBus8PtOa9KaT5ZuxC1kAsd7JEHqWt4YXuY9eancX0GK9C68i5OROnlIzBA==",
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.8.0.tgz",
"integrity": "sha512-lFb4VCDleFSR+eo4Ew+HvrJ37ZH1Y9ZyE+qyP7EiwBpcCVxwmUc5PAqhShCQ8N8U5vqYydm74nss+a0wrrCErw==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "2.24.0",
"eslint-utils": "^1.4.3",
"@typescript-eslint/experimental-utils": "3.8.0",
"debug": "^4.1.1",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0",
"semver": "^7.3.2",
"tsutils": "^3.17.1"
},
"dependencies": {
"@typescript-eslint/experimental-utils": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.8.0.tgz",
"integrity": "sha512-o8T1blo1lAJE0QDsW7nSyvZHbiDzQDjINJKyB44Z3sSL39qBy5L10ScI/XwDtaiunoyKGLiY9bzRk4YjsUZl8w==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/types": "3.8.0",
"@typescript-eslint/typescript-estree": "3.8.0",
"eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0"
}
},
"@typescript-eslint/typescript-estree": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.8.0.tgz",
"integrity": "sha512-MTv9nPDhlKfclwnplRNDL44mP2SY96YmPGxmMbMy6x12I+pERcxpIUht7DXZaj4mOKKtet53wYYXU0ABaiXrLw==",
"dev": true,
"requires": {
"@typescript-eslint/types": "3.8.0",
"@typescript-eslint/visitor-keys": "3.8.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"
}
},
"eslint-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
"integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
"dev": true,
"requires": {
"eslint-visitor-keys": "^1.1.0"
}
},
"regexpp": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.0.0.tgz",
"integrity": "sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g==",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
"integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
"dev": true
},
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
"dev": true
}
}
@ -3682,6 +3727,12 @@
"eslint-visitor-keys": "^1.1.0"
}
},
"@typescript-eslint/types": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.8.0.tgz",
"integrity": "sha512-8kROmEQkv6ss9kdQ44vCN1dTrgu4Qxrd2kXr10kz2NP5T8/7JnEfYNxCpPkArbLIhhkGLZV3aVMplH1RXQRF7Q==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.24.0.tgz",
@ -3705,6 +3756,15 @@
}
}
},
"@typescript-eslint/visitor-keys": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.8.0.tgz",
"integrity": "sha512-gfqQWyVPpT9NpLREXNR820AYwgz+Kr1GuF3nf1wxpHD6hdxI62tq03ToomFnDxY0m3pUB39IF7sil7D5TQexLA==",
"dev": true,
"requires": {
"eslint-visitor-keys": "^1.1.0"
}
},
"@webassemblyjs/ast": {
"version": "1.8.5",
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz",
@ -7678,6 +7738,16 @@
"integrity": "sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=",
"dev": true
},
"eslint-scope": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz",
"integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==",
"dev": true,
"requires": {
"esrecurse": "^4.1.0",
"estraverse": "^4.1.1"
}
},
"eslint-utils": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz",

View File

@ -147,7 +147,7 @@
"@types/webpack-dev-middleware": "3.7.0",
"@types/webpack-hot-middleware": "2.25.0",
"@types/ws": "7.2.3",
"@typescript-eslint/eslint-plugin": "2.24.0",
"@typescript-eslint/eslint-plugin": "3.8.0",
"@typescript-eslint/parser": "2.24.0",
"autoprefixer": "9.7.6",
"babel-eslint": "10.1.0",

View File

@ -11,7 +11,7 @@ type DropDownButtonProps = {
}[];
dataKey: string;
dataIndex?: string;
onButtonChange: (e: React.MouseEvent<{}>) => void;
onButtonChange: (e: React.MouseEvent<unknown>) => void;
onInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
value?: string;
inputVal: string;

View File

@ -91,7 +91,7 @@ const SearchableSelect: React.FC<SearchableSelectProps> = ({
const customStyles: Record<string, any> = {};
if (styleOverrides) {
Object.keys(styleOverrides).forEach(comp => {
customStyles[comp] = (provided: object) => ({
customStyles[comp] = (provided: Record<string, unknown>) => ({
...provided,
...styleOverrides[comp],
});

View File

@ -1,4 +1,4 @@
export const UNSAFE_keys = <T extends object>(source: T) =>
export const UNSAFE_keys = <T extends Record<string, unknown>>(source: T) =>
Object.keys(source) as Array<keyof T>;
export type Json =

View File

@ -11,9 +11,9 @@ import RuntimeError from './RuntimeError';
import { registerRunTimeError } from '../Main/Actions';
export interface Metadata {
inconsistentObjects: object[];
inconsistentObjects: Record<string, unknown>[];
ongoingRequest: boolean;
allowedQueries: object[];
allowedQueries: Record<string, unknown>[];
}
export interface ErrorBoundaryProps {

View File

@ -25,7 +25,7 @@ export interface MainState {
error: Error | null;
isFetching: boolean;
};
featuresCompatibility: object;
featuresCompatibility: Record<string, unknown>;
postgresVersion: string | null;
}

View File

@ -11,14 +11,14 @@ export type OperationData = {
displayName: string;
type: OperationTypeNode;
variableName: string;
variables: object;
variables: Record<string, unknown>;
operationDefinition: OperationDefinitionNode;
};
export type GenerateOptions = {
serverUrl: string;
headers: { [name: string]: string };
context: object;
context: Record<string, unknown>;
operationDataList: Array<OperationData>;
options: OptionValues;
};

View File

@ -115,7 +115,7 @@ const getFreqUsedColDisplayInfo = (c: FrequentlyUsedColumn) => {
};
interface FrequentlyUsedColumnSelectorProps {
onSelect: Function;
onSelect: any;
action: ColumnAction | null;
dispatch: Dispatch | null;
postgresVersion: string | null;

View File

@ -1,11 +1,10 @@
import React from 'react';
import { ThunkDispatch } from 'redux-thunk';
import { AnyAction } from 'redux';
import ReloadMetadata from '../../../Settings/MetadataOptions/ReloadMetadata';
import { Dispatch } from '../../../../../types';
export interface ReloadEnumValuesButtonProps {
isEnum: boolean;
dispatch: ThunkDispatch<{}, {}, AnyAction>;
dispatch: Dispatch;
tooltipStyle?: string;
}

View File

@ -56,9 +56,9 @@ export interface TableRowProps {
refName: 'valueNode' | 'nullNode' | 'defaultNode' | 'insertRadioNode',
node: HTMLInputElement | null
) => void;
enumOptions: object;
enumOptions: Record<string, unknown>;
index: number;
clone?: object;
clone?: Record<string, unknown>;
onChange?: (e: React.ChangeEvent<HTMLInputElement>, val: unknown) => void;
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
prevValue?: unknown;

View File

@ -5,7 +5,7 @@ import RawSqlButton from '../Common/Components/RawSqlButton';
export interface ViewDefinitionsProps {
dispatch: () => void;
sql: string | object;
sql: string | Record<string, unknown>;
}
const ViewDefinitions: React.FC<ViewDefinitionsProps> = ({ dispatch, sql }) => (

View File

@ -119,7 +119,7 @@ type ExternalProps = RouteComponentProps<
{
triggerName: string;
},
{}
unknown
>;
const mapStateToProps: MapStateToProps<PropsFromState, ExternalProps> = (

View File

@ -26,7 +26,7 @@ export type RouterTriggerProps = RouteComponentProps<
{
triggerName: string;
},
{}
unknown
>;
export type TriggerKind = 'event' | 'cron';

View File

@ -5,13 +5,13 @@ import Sidebar from './Sidebar';
import PageContainer from '../../Common/Layout/PageContainer/PageContainer';
type Metadata = {
inconsistentObjects: object[];
inconsistentObjects: Record<string, unknown>[];
ongoingRequest: boolean;
allowedQueries: object[];
allowedQueries: Record<string, any>[];
};
type ExternalProps = {
location: RouteComponentProps<{}, {}>['location'];
location: RouteComponentProps<unknown, unknown>['location'];
children: JSX.Element;
};
@ -55,6 +55,8 @@ const mapStateToProps = (state: DerivedState) => {
type StateProps = ReturnType<typeof mapStateToProps>;
const connector = (connect: Connect) =>
connect<StateProps, {}, {}, DerivedState>(mapStateToProps)(Container);
connect<StateProps, unknown, unknown, DerivedState>(mapStateToProps)(
Container
);
export default connector;

View File

@ -10,11 +10,11 @@ import { getAdminSecret } from '../ApiExplorer/ApiRequest/utils';
import styles from '../../Common/TableCommon/Table.scss';
interface Metadata {
inconsistentObjects: object[];
inconsistentObjects: Record<string, unknown>[];
}
type SidebarProps = {
location: RouteComponentProps<{}, {}>['location'];
location: RouteComponentProps<unknown, unknown>['location'];
metadata: Metadata;
};

View File

@ -26,10 +26,10 @@ type Telemetry = {
const setConsoleOptsInDB = (
opts: TelemetryState['console_opts'],
successCb: (arg: object) => void,
successCb: (arg: Record<string, any>) => void,
errorCb: (arg: Error) => void
) => (
dispatch: ThunkDispatch<ReduxState, {}, AnyAction>,
dispatch: ThunkDispatch<ReduxState, unknown, AnyAction>,
getState: GetReduxState
) => {
const url = Endpoints.getSchema;
@ -66,7 +66,7 @@ const setConsoleOptsInDB = (
// eslint-disable-next-line consistent-return
return dispatch(requestAction(url, options)).then(
(data: object) => {
(data: Record<string, unknown>) => {
if (successCb) {
successCb(data);
}
@ -86,7 +86,7 @@ const telemetryNotificationShown = () => (
};
const setTelemetryNotificationShownInDB = () => {
const successCb = (data: object) => {
const successCb = (data: Record<string, unknown>) => {
console.log(
`Updated telemetry notification status in db ${JSON.stringify(data)}`
);
@ -108,7 +108,7 @@ const setTelemetryNotificationShownInDB = () => {
};
const setPreReleaseNotificationOptOutInDB = () => (
dispatch: ThunkDispatch<ReduxState, {}, AnyAction>
dispatch: ThunkDispatch<ReduxState, unknown, AnyAction>
) => {
const successCb = () => {
dispatch(
@ -132,7 +132,7 @@ const setPreReleaseNotificationOptOutInDB = () => (
const loadConsoleOpts = () => {
return (
dispatch: ThunkDispatch<ReduxState, {}, AnyAction>,
dispatch: ThunkDispatch<ReduxState, unknown, AnyAction>,
getState: GetReduxState
) => {
const url = Endpoints.getSchema;
@ -172,12 +172,12 @@ const loadConsoleOpts = () => {
interface SetConsoleOptsAction {
type: typeof SET_CONSOLE_OPTS;
data: object;
data: Record<string, unknown>;
}
interface SetNotificationShowAction {
type: typeof SET_NOTIFICATION_SHOWN;
data?: object;
data?: Record<string, unknown>;
}
interface SetHasuraUuid {
@ -193,7 +193,7 @@ type TelemetryActionTypes =
export const requireConsoleOpts = ({
dispatch,
}: {
dispatch: ThunkDispatch<ReduxState, {}, AnyAction>;
dispatch: ThunkDispatch<ReduxState, unknown, AnyAction>;
}) => (nextState: ReduxState, replaceState: ReduxState, callback: any) => {
dispatch(loadConsoleOpts()).finally(callback);
};

View File

@ -6,13 +6,13 @@ import { setTelemetryNotificationShownInDB } from './Actions';
import { ReduxState } from '../types';
const onRemove = () => {
return (dispatch: ThunkDispatch<ReduxState, {}, AnyAction>) => {
return (dispatch: ThunkDispatch<ReduxState, unknown, AnyAction>) => {
dispatch(setTelemetryNotificationShownInDB());
};
};
const showTelemetryNotification = () => {
return (dispatch: ThunkDispatch<ReduxState, {}, AnyAction>) => {
return (dispatch: ThunkDispatch<ReduxState, unknown, AnyAction>) => {
dispatch(
Notifications.show({
position: 'tr',

View File

@ -61,8 +61,8 @@ export interface MiscellaneousColumnType {
}
export interface JSONColumnType {
json: object;
jsonb: object;
json: Record<string, unknown>;
jsonb: Record<string, unknown>;
}
export type JSONColumn = keyof JSONColumnType;