Chore: ESlint import order (#44959)

* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
This commit is contained in:
Josh Hunt
2022-04-22 14:33:13 +01:00
committed by GitHub
parent 147a1600e7
commit 3c6e0e8ef8
3311 changed files with 14810 additions and 9526 deletions
@@ -1,5 +1,6 @@
import React, { useState } from 'react';
import { css } from '@emotion/css';
import React, { useState } from 'react';
import { GrafanaTheme2 } from '@grafana/data';
import {
Button,
@@ -1,12 +1,14 @@
import React, { useCallback } from 'react';
import { connect } from 'react-redux';
import { Form, Button, Input, Field } from '@grafana/ui';
import { useHistory } from 'react-router-dom';
import { NavModel } from '@grafana/data';
import { getBackendSrv } from '@grafana/runtime';
import { StoreState } from '../../types';
import { getNavModel } from '../../core/selectors/navModel';
import { Form, Button, Input, Field } from '@grafana/ui';
import Page from 'app/core/components/Page/Page';
import { useHistory } from 'react-router-dom';
import { getNavModel } from '../../core/selectors/navModel';
import { StoreState } from '../../types';
interface ServiceAccountCreatePageProps {
navModel: NavModel;
@@ -1,10 +1,17 @@
import React, { useEffect, useState } from 'react';
import { connect, ConnectedProps } from 'react-redux';
import { getNavModel } from 'app/core/selectors/navModel';
import { getTimeZone, NavModel } from '@grafana/data';
import { Button } from '@grafana/ui';
import Page from 'app/core/components/Page/Page';
import { ServiceAccountProfile } from './ServiceAccountProfile';
import { StoreState, ServiceAccountDTO, ApiKey, Role, AccessControlAction } from 'app/types';
import { contextSrv } from 'app/core/core';
import { GrafanaRouteComponentProps } from 'app/core/navigation/types';
import { getNavModel } from 'app/core/selectors/navModel';
import { StoreState, ServiceAccountDTO, ApiKey, Role, AccessControlAction } from 'app/types';
import { CreateTokenModal, ServiceAccountToken } from './CreateServiceAccountTokenModal';
import { ServiceAccountProfile } from './ServiceAccountProfile';
import { ServiceAccountTokensTable } from './ServiceAccountTokensTable';
import {
deleteServiceAccountToken,
loadServiceAccount,
@@ -14,11 +21,6 @@ import {
updateServiceAccount,
deleteServiceAccount,
} from './state/actions';
import { ServiceAccountTokensTable } from './ServiceAccountTokensTable';
import { getTimeZone, NavModel } from '@grafana/data';
import { Button } from '@grafana/ui';
import { CreateTokenModal, ServiceAccountToken } from './CreateServiceAccountTokenModal';
import { contextSrv } from 'app/core/core';
interface OwnProps extends GrafanaRouteComponentProps<{ id: string }> {
navModel: NavModel;
@@ -1,10 +1,12 @@
import React, { PureComponent, useRef, useState } from 'react';
import { Role, ServiceAccountDTO, AccessControlAction } from 'app/types';
import { css, cx } from '@emotion/css';
import React, { PureComponent, useRef, useState } from 'react';
import { dateTimeFormat, GrafanaTheme2, OrgRole, TimeZone } from '@grafana/data';
import { Button, ConfirmButton, ConfirmModal, Input, LegacyInputStatus, useStyles2 } from '@grafana/ui';
import { ServiceAccountRoleRow } from './ServiceAccountRoleRow';
import { contextSrv } from 'app/core/core';
import { Role, ServiceAccountDTO, AccessControlAction } from 'app/types';
import { ServiceAccountRoleRow } from './ServiceAccountRoleRow';
interface Props {
serviceAccount: ServiceAccountDTO;
@@ -1,9 +1,11 @@
import React, { PureComponent } from 'react';
import { css, cx } from '@emotion/css';
import { AccessControlAction, OrgRole, Role, ServiceAccountDTO } from 'app/types';
import { OrgRolePicker } from '../admin/OrgRolePicker';
import { contextSrv } from 'app/core/core';
import React, { PureComponent } from 'react';
import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker';
import { contextSrv } from 'app/core/core';
import { AccessControlAction, OrgRole, Role, ServiceAccountDTO } from 'app/types';
import { OrgRolePicker } from '../admin/OrgRolePicker';
interface Props {
label: string;
@@ -1,11 +1,12 @@
import React, { FC } from 'react';
import { DeleteButton, Icon, Tooltip, useStyles2, useTheme2 } from '@grafana/ui';
import { dateTimeFormat, GrafanaTheme2, TimeZone } from '@grafana/data';
import { AccessControlAction } from 'app/types';
import { ApiKey } from '../../types';
import { css } from '@emotion/css';
import React, { FC } from 'react';
import { dateTimeFormat, GrafanaTheme2, TimeZone } from '@grafana/data';
import { DeleteButton, Icon, Tooltip, useStyles2, useTheme2 } from '@grafana/ui';
import { contextSrv } from 'app/core/core';
import { AccessControlAction } from 'app/types';
import { ApiKey } from '../../types';
interface Props {
tokens: ApiKey[];
@@ -1,11 +1,14 @@
import { cx } from '@emotion/css';
import React, { memo } from 'react';
import { OrgRole } from '@grafana/data';
import { Button, Icon, useStyles2 } from '@grafana/ui';
import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker';
import { contextSrv } from 'app/core/core';
import { AccessControlAction, Role, ServiceAccountDTO } from 'app/types';
import React, { memo } from 'react';
import { OrgRolePicker } from '../admin/OrgRolePicker';
import { getStyles } from './ServiceAccountsListPage';
type ServiceAccountListItemProps = {
@@ -1,10 +1,18 @@
import { css, cx } from '@emotion/css';
import pluralize from 'pluralize';
import React, { useEffect } from 'react';
import { connect, ConnectedProps } from 'react-redux';
import { ConfirmModal, FilterInput, LinkButton, RadioButtonGroup, useStyles2 } from '@grafana/ui';
import { css, cx } from '@emotion/css';
import { GrafanaTheme2, OrgRole } from '@grafana/data';
import { ConfirmModal, FilterInput, LinkButton, RadioButtonGroup, useStyles2 } from '@grafana/ui';
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
import Page from 'app/core/components/Page/Page';
import PageLoader from 'app/core/components/PageLoader/PageLoader';
import { contextSrv } from 'app/core/core';
import { getNavModel } from 'app/core/selectors/navModel';
import { StoreState, ServiceAccountDTO, AccessControlAction } from 'app/types';
import ServiceAccountListItem from './ServiceAccountsListItem';
import {
changeFilter,
changeQuery,
@@ -14,13 +22,6 @@ import {
updateServiceAccount,
setServiceAccountToRemove,
} from './state/actions';
import { getNavModel } from 'app/core/selectors/navModel';
import PageLoader from 'app/core/components/PageLoader/PageLoader';
import { GrafanaTheme2, OrgRole } from '@grafana/data';
import { contextSrv } from 'app/core/core';
import pluralize from 'pluralize';
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
import ServiceAccountListItem from './ServiceAccountsListItem';
interface OwnProps {}
@@ -1,5 +1,13 @@
import { ServiceAccountDTO, ThunkResult, ServiceAccountFilter, AccessControlAction } from '../../../types';
import { debounce } from 'lodash';
import { getBackendSrv, locationService } from '@grafana/runtime';
import { fetchBuiltinRoles, fetchRoleOptions } from 'app/core/components/RolePicker/api';
import { accessControlQueryParam } from 'app/core/utils/accessControl';
import { contextSrv } from '../../../core/services/context_srv';
import { ServiceAccountDTO, ThunkResult, ServiceAccountFilter, AccessControlAction } from '../../../types';
import { ServiceAccountToken } from '../CreateServiceAccountTokenModal';
import {
acOptionsLoaded,
builtInRolesLoaded,
@@ -13,11 +21,6 @@ import {
serviceAccountTokensLoaded,
serviceAccountToRemoveLoaded,
} from './reducers';
import { accessControlQueryParam } from 'app/core/utils/accessControl';
import { fetchBuiltinRoles, fetchRoleOptions } from 'app/core/components/RolePicker/api';
import { debounce } from 'lodash';
import { contextSrv } from '../../../core/services/context_srv';
import { ServiceAccountToken } from '../CreateServiceAccountTokenModal';
const BASE_URL = `/api/serviceaccounts`;