Skip to content

Commit

Permalink
fix tsc config
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Schultz <pschultz@pobox.com>
  • Loading branch information
schultzp2020 committed Oct 22, 2024
1 parent b64202f commit b261627
Show file tree
Hide file tree
Showing 47 changed files with 136 additions and 125 deletions.
13 changes: 12 additions & 1 deletion dynamic-plugins/wrappers/backstage-plugin-techdocs/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
const backstageConfig = require('@backstage/cli/config/eslint-factory')(
__dirname,
);

module.exports = {
...backstageConfig,
rules: {
...backstageConfig.rules,
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
},
};
25 changes: 12 additions & 13 deletions dynamic-plugins/wrappers/backstage-plugin-techdocs/src/wrapped.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import React from 'react';
import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
import {
TechDocsReaderPage as TechDocsReaderPageBase,
EntityTechdocsContent as EntityTechdocsContentBase,
} from '@backstage/plugin-techdocs';
TechDocsReaderPage as TechDocsReaderPageBase,
} from "@backstage/plugin-techdocs";
import { ReportIssue } from "@backstage/plugin-techdocs-module-addons-contrib";
import { TechDocsAddons } from "@backstage/plugin-techdocs-react";

import { SearchFilter, useSearch } from '@backstage/plugin-search-react';
import { SearchFilter, useSearch } from "@backstage/plugin-search-react";

import {
CATALOG_FILTER_EXISTS,
catalogApiRef,
} from '@backstage/plugin-catalog-react';
} from "@backstage/plugin-catalog-react";

import { useApi } from '@backstage/core-plugin-api';
import { useApi } from "@backstage/core-plugin-api";

export const TechDocsReaderPage = {
element: TechDocsReaderPageBase,
Expand All @@ -37,7 +36,7 @@ export const TechdocsSearchFilter = () => {
const { types } = useSearch();
const catalogApi = useApi(catalogApiRef);

if (!types.includes('techdocs')) {
if (!types.includes("techdocs")) {
return null;
}

Expand All @@ -48,13 +47,13 @@ export const TechdocsSearchFilter = () => {
values={async () => {
// Return a list of entities which are documented.
const { items } = await catalogApi.getEntities({
fields: ['metadata.name'],
fields: ["metadata.name"],
filter: {
'metadata.annotations.backstage.io/techdocs-ref':
"metadata.annotations.backstage.io/techdocs-ref":
CATALOG_FILTER_EXISTS,
},
});
return items.map(entity => entity.metadata.name).sort();
return items.map((entity) => entity.metadata.name).sort();
}}
/>
);
Expand All @@ -63,5 +62,5 @@ export const TechdocsSearchFilter = () => {
export const techdocsSearchType = (name: string, icon: React.ReactNode) => ({
name,
icon,
value: 'techdocs',
value: "techdocs",
});
13 changes: 12 additions & 1 deletion packages/app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
const backstageConfig = require('@backstage/cli/config/eslint-factory')(
__dirname,
);

module.exports = {
...backstageConfig,
rules: {
...backstageConfig.rules,
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
},
};
8 changes: 4 additions & 4 deletions packages/app/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import { lazy, Suspense } from 'react';

import { removeScalprum } from '@scalprum/core';
import { mockPluginData } from '@scalprum/react-test-utils';
import { render, waitFor } from '@testing-library/react';

import TestRoot from './utils/test/TestRoot';

const AppBase = React.lazy(() => import('./components/AppBase'));
const AppBase = lazy(() => import('./components/AppBase'));

describe('App', () => {
beforeEach(() => {
Expand All @@ -31,9 +31,9 @@ describe('App', () => {
const rendered = render(
<TestScalprumProvider>
<TestRoot>
<React.Suspense fallback={null}>
<Suspense fallback={null}>
<AppBase />
</React.Suspense>
</Suspense>
</TestRoot>
</TestScalprumProvider>,
);
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import { apis } from './apis';
import { StaticPlugins } from './components/DynamicRoot/DynamicRoot';
import ScalprumRoot from './components/DynamicRoot/ScalprumRoot';
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/bootstrap.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import ReactDOM from 'react-dom/client';

import App from './App';
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/common.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import { CodeSnippet, WarningPanel } from '@backstage/core-components';

export const fetcher: <T>(...args: Parameters<typeof fetch>) => Promise<T[]> = <
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/DynamicRoot/Loader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import Box from '@mui/material/Box';
import CircularProgress from '@mui/material/CircularProgress';
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/DynamicRoot/ScalprumRoot.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-shadow */

import React from 'react';

import useAsync from 'react-use/lib/useAsync';

import { AppConfig } from '@backstage/config';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import { AppComponents } from '@backstage/core-plugin-api';

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/Root/LogoFull.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import { styled } from '@mui/material/styles';

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/Root/LogoIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import { styled } from '@mui/material/styles';

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/Root/MenuIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import { useApp } from '@backstage/core-plugin-api';

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/Root/SidebarLogo.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

import { BrowserRouter } from 'react-router-dom';

import { useSidebarOpenState } from '@backstage/core-components';
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/Root/SidebarLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import { Link, useSidebarOpenState } from '@backstage/core-components';
import { configApiRef, useApi } from '@backstage/core-plugin-api';
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/components/SignInPage/SignInPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import {
SignInPage as CCSignInPage,
ProxiedSignInPage,
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/components/UserSettings/GeneralPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import {
UserSettingsAppearanceCard,
UserSettingsIdentityCard,
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/components/UserSettings/InfoCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import { InfoCard as BSInfoCard } from '@backstage/core-components';

import Grid from '@mui/material/Grid';
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/components/UserSettings/SettingsPages.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import {
SettingsLayout,
UserSettingsAuthProviders,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';


import {
EntityConsumedApisCard,
EntityProvidedApisCard,
EntityConsumedApisCard,
EntityProvidedApisCard,
} from '@backstage/plugin-api-docs';
import { EntitySwitch, isKind } from '@backstage/plugin-catalog';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import { EntityApiDefinitionCard } from '@backstage/plugin-api-docs';
import { EntitySwitch, isKind } from '@backstage/plugin-catalog';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import React from 'react';


import {
EntityConsumedApisCard,
EntityProvidedApisCard,
EntityConsumedApisCard,
EntityProvidedApisCard,
} from '@backstage/plugin-api-docs';
import {
EntityDependsOnComponentsCard,
EntityDependsOnResourcesCard,
EntityHasSubcomponentsCard,
EntitySwitch,
isKind,
EntityDependsOnComponentsCard,
EntityDependsOnResourcesCard,
EntityHasSubcomponentsCard,
EntitySwitch,
isKind,
} from '@backstage/plugin-catalog';
import {
Direction,
EntityCatalogGraphCard,
Direction,
EntityCatalogGraphCard,
} from '@backstage/plugin-catalog-graph';

import Grid from '../Grid';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import React from 'react';


import {
RELATION_API_CONSUMED_BY,
RELATION_API_PROVIDED_BY,
RELATION_CONSUMES_API,
RELATION_DEPENDENCY_OF,
RELATION_DEPENDS_ON,
RELATION_HAS_PART,
RELATION_PART_OF,
RELATION_PROVIDES_API,
RELATION_API_CONSUMED_BY,
RELATION_API_PROVIDED_BY,
RELATION_CONSUMES_API,
RELATION_DEPENDENCY_OF,
RELATION_DEPENDS_ON,
RELATION_HAS_PART,
RELATION_PART_OF,
RELATION_PROVIDES_API,
} from '@backstage/catalog-model';
import { EntitySwitch, isKind } from '@backstage/plugin-catalog';
import {
Direction,
EntityCatalogGraphCard,
Direction,
EntityCatalogGraphCard,
} from '@backstage/plugin-catalog-graph';

import Grid from '../Grid';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import { Entity } from '@backstage/catalog-model';
import { ApiHolder } from '@backstage/core-plugin-api';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import { ContextMenuAwareEntityLayout } from './ContextMenuAwareEntityLayout';
import { defaultTabs, tabChildren, tabRules } from './defaultTabs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import React from 'react';


import {
EntityConsumingComponentsCard,
EntityHasApisCard,
EntityProvidingComponentsCard,
EntityConsumingComponentsCard,
EntityHasApisCard,
EntityProvidingComponentsCard,
} from '@backstage/plugin-api-docs';
import {
EntityAboutCard,
EntityHasComponentsCard,
EntityHasResourcesCard,
EntityHasSystemsCard,
EntityLinksCard,
EntityOrphanWarning,
EntityProcessingErrorsPanel,
EntityRelationWarning,
EntitySwitch,
hasCatalogProcessingErrors,
hasRelationWarnings,
isKind,
isOrphan,
EntityAboutCard,
EntityHasComponentsCard,
EntityHasResourcesCard,
EntityHasSystemsCard,
EntityLinksCard,
EntityOrphanWarning,
EntityProcessingErrorsPanel,
EntityRelationWarning,
EntitySwitch,
hasCatalogProcessingErrors,
hasRelationWarnings,
isKind,
isOrphan,
} from '@backstage/plugin-catalog';
import { EntityCatalogGraphCard } from '@backstage/plugin-catalog-graph';
import {
EntityGroupProfileCard,
EntityMembersListCard,
EntityOwnershipCard,
EntityUserProfileCard,
EntityGroupProfileCard,
EntityMembersListCard,
EntityOwnershipCard,
EntityUserProfileCard,
} from '@backstage/plugin-org';

import Grid from '../Grid';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import { Entity } from '@backstage/catalog-model';
import { isKind } from '@backstage/plugin-catalog';
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/catalog/Grid/Grid.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import Box, { BoxProps } from '@mui/material/Box';
import { makeStyles } from 'tss-react/mui';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import { Content, Header, InfoCard, Page } from '@backstage/core-components';
import { SearchContextProvider } from '@backstage/plugin-search-react';
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/components/search/SearchPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import { CatalogIcon, Content, Header, Page } from '@backstage/core-components';
import { CatalogSearchResultListItem } from '@backstage/plugin-catalog';
import { SearchType } from '@backstage/plugin-search';
Expand Down
13 changes: 12 additions & 1 deletion plugins/dynamic-home-page/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
const backstageConfig = require('@backstage/cli/config/eslint-factory')(
__dirname,
);

module.exports = {
...backstageConfig,
rules: {
...backstageConfig.rules,
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
},
};
2 changes: 1 addition & 1 deletion plugins/dynamic-home-page/dev/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';


import { createDevApp, DevAppPageOptions } from '@backstage/dev-utils';
import {
Expand Down
Loading

0 comments on commit b261627

Please sign in to comment.