aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js
diff options
context:
space:
mode:
authorDavid Cho-Lerat <david.cho-lerat@sonarsource.com>2023-12-01 17:36:45 +0100
committersonartech <sonartech@sonarsource.com>2023-12-01 20:02:43 +0000
commita09640caa789513e1f533ffcb474a3541055e253 (patch)
tree67511f198da42e49714f4124fc23844274a0b4f0 /server/sonar-web/src/main/js
parentd1531b2c4390c351746a311a6f85e66651879d23 (diff)
downloadsonarqube-a09640caa789513e1f533ffcb474a3541055e253.tar.gz
sonarqube-a09640caa789513e1f533ffcb474a3541055e253.zip
Remove extra React.PropsWithChildren wrappers introduced by the React 18 codemod
Diffstat (limited to 'server/sonar-web/src/main/js')
-rw-r--r--server/sonar-web/src/main/js/app/components/admin/withAdminPagesOutletContext.tsx4
-rw-r--r--server/sonar-web/src/main/js/app/components/app-state/withAppStateContext.tsx4
-rw-r--r--server/sonar-web/src/main/js/app/components/available-features/withAvailableFeatures.tsx4
-rw-r--r--server/sonar-web/src/main/js/app/components/componentContext/withComponentContext.tsx2
-rw-r--r--server/sonar-web/src/main/js/app/components/languages/withLanguagesContext.tsx4
-rw-r--r--server/sonar-web/src/main/js/app/components/metrics/withMetricsContext.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/qualityProfilesContext.tsx13
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/inputs/Input.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSecured.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.tsx6
-rw-r--r--server/sonar-web/src/main/js/components/hoc/utils.ts2
-rw-r--r--server/sonar-web/src/main/js/components/hoc/whenLoggedIn.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/hoc/withCLanguageFeature.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/hoc/withIndexationContext.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/hoc/withIndexationGuard.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/hoc/withLocation.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/hoc/withNotifications.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/hoc/withRouter.tsx11
-rw-r--r--server/sonar-web/src/main/js/components/icons/ProjectLinkIcon.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsStep.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/workspace/WorkspaceHeader.tsx2
-rw-r--r--server/sonar-web/src/main/js/helpers/testUtils.ts6
-rw-r--r--server/sonar-web/src/main/js/queries/branch.tsx10
25 files changed, 36 insertions, 79 deletions
diff --git a/server/sonar-web/src/main/js/app/components/admin/withAdminPagesOutletContext.tsx b/server/sonar-web/src/main/js/app/components/admin/withAdminPagesOutletContext.tsx
index b5d3da6ff84..3de71cd7aa0 100644
--- a/server/sonar-web/src/main/js/app/components/admin/withAdminPagesOutletContext.tsx
+++ b/server/sonar-web/src/main/js/app/components/admin/withAdminPagesOutletContext.tsx
@@ -22,9 +22,7 @@ import { useOutletContext } from 'react-router-dom';
import { AdminPagesContext } from '../../../types/admin';
export default function withAdminPagesOutletContext(
- WrappedComponent: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<AdminPagesContext>>
- >,
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<AdminPagesContext>>,
) {
return function WithAdminPagesOutletContext() {
const { adminPages } = useOutletContext<AdminPagesContext>();
diff --git a/server/sonar-web/src/main/js/app/components/app-state/withAppStateContext.tsx b/server/sonar-web/src/main/js/app/components/app-state/withAppStateContext.tsx
index 5a0b13d06af..51cd7d808a4 100644
--- a/server/sonar-web/src/main/js/app/components/app-state/withAppStateContext.tsx
+++ b/server/sonar-web/src/main/js/app/components/app-state/withAppStateContext.tsx
@@ -27,9 +27,7 @@ export interface WithAppStateContextProps {
}
export default function withAppStateContext<P>(
- WrappedComponent: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<P & WithAppStateContextProps>>
- >,
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P & WithAppStateContextProps>>,
) {
return class WithAppStateContext extends React.PureComponent<
Omit<P, keyof WithAppStateContextProps>
diff --git a/server/sonar-web/src/main/js/app/components/available-features/withAvailableFeatures.tsx b/server/sonar-web/src/main/js/app/components/available-features/withAvailableFeatures.tsx
index 5a25ac62230..278938b48ad 100644
--- a/server/sonar-web/src/main/js/app/components/available-features/withAvailableFeatures.tsx
+++ b/server/sonar-web/src/main/js/app/components/available-features/withAvailableFeatures.tsx
@@ -27,9 +27,7 @@ export interface WithAvailableFeaturesProps {
}
export default function withAvailableFeatures<P>(
- WrappedComponent: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<P & WithAvailableFeaturesProps>>
- >,
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P & WithAvailableFeaturesProps>>,
) {
return class WithAvailableFeatures extends React.PureComponent<
Omit<P, keyof WithAvailableFeaturesProps>
diff --git a/server/sonar-web/src/main/js/app/components/componentContext/withComponentContext.tsx b/server/sonar-web/src/main/js/app/components/componentContext/withComponentContext.tsx
index 122706e9f63..eeab47a144d 100644
--- a/server/sonar-web/src/main/js/app/components/componentContext/withComponentContext.tsx
+++ b/server/sonar-web/src/main/js/app/components/componentContext/withComponentContext.tsx
@@ -23,7 +23,7 @@ import { ComponentContextShape } from '../../../types/component';
import { ComponentContext } from './ComponentContext';
export default function withComponentContext<P extends Partial<ComponentContextShape>>(
- WrappedComponent: React.ComponentType<React.PropsWithChildren<React.PropsWithChildren<P>>>,
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P>>,
) {
return class WithComponentContext extends React.PureComponent<
Omit<P, keyof ComponentContextShape>
diff --git a/server/sonar-web/src/main/js/app/components/languages/withLanguagesContext.tsx b/server/sonar-web/src/main/js/app/components/languages/withLanguagesContext.tsx
index 6b2324f4d24..fd562c9e388 100644
--- a/server/sonar-web/src/main/js/app/components/languages/withLanguagesContext.tsx
+++ b/server/sonar-web/src/main/js/app/components/languages/withLanguagesContext.tsx
@@ -27,9 +27,7 @@ export interface WithLanguagesContextProps {
}
export default function withLanguagesContext<P>(
- WrappedComponent: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<P & WithLanguagesContextProps>>
- >,
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P & WithLanguagesContextProps>>,
) {
return class WithLanguagesContext extends React.PureComponent<
Omit<P, keyof WithLanguagesContextProps>
diff --git a/server/sonar-web/src/main/js/app/components/metrics/withMetricsContext.tsx b/server/sonar-web/src/main/js/app/components/metrics/withMetricsContext.tsx
index 7c069e4ac36..496cecb8ffa 100644
--- a/server/sonar-web/src/main/js/app/components/metrics/withMetricsContext.tsx
+++ b/server/sonar-web/src/main/js/app/components/metrics/withMetricsContext.tsx
@@ -27,9 +27,7 @@ export interface WithMetricsContextProps {
}
export default function withMetricsContext<P>(
- WrappedComponent: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<P & WithMetricsContextProps>>
- >,
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P & WithMetricsContextProps>>,
) {
return class WithMetricsContext extends React.PureComponent<
Omit<P, keyof WithMetricsContextProps>
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/qualityProfilesContext.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/qualityProfilesContext.tsx
index 30e6b39962d..3d3a933875e 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/qualityProfilesContext.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/qualityProfilesContext.tsx
@@ -34,20 +34,15 @@ export interface QualityProfilesContextProps {
}
export function withQualityProfilesContext<P extends Partial<QualityProfilesContextProps>>(
- WrappedComponent: React.ComponentType<React.PropsWithChildren<React.PropsWithChildren<P>>>,
-): React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<Omit<P, keyof QualityProfilesContextProps>>>
-> {
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P>>,
+): React.ComponentType<React.PropsWithChildren<Omit<P, keyof QualityProfilesContextProps>>> {
function ComponentWithQualityProfilesProps(props: P) {
const context = useOutletContext<QualityProfilesContextProps>();
return <WrappedComponent {...props} {...context} />;
}
- (
- ComponentWithQualityProfilesProps as React.FC<
- React.PropsWithChildren<React.PropsWithChildren<P>>
- >
- ).displayName = getWrappedDisplayName(WrappedComponent, 'withQualityProfilesContext');
+ (ComponentWithQualityProfilesProps as React.FC<React.PropsWithChildren<P>>).displayName =
+ getWrappedDisplayName(WrappedComponent, 'withQualityProfilesContext');
return ComponentWithQualityProfilesProps;
}
diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.tsx
index b6740aa1466..caf3af3f7b2 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.tsx
+++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.tsx
@@ -37,9 +37,8 @@ export default function Input(props: Readonly<DefaultInputProps>) {
const { definition } = setting;
const name = getUniqueName(definition);
- let Input: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<DefaultSpecializedInputProps>>
- > = PrimitiveInput;
+ let Input: React.ComponentType<React.PropsWithChildren<DefaultSpecializedInputProps>> =
+ PrimitiveInput;
if (isCategoryDefinition(definition) && definition.multiValues) {
Input = MultiValueInput;
diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSecured.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSecured.tsx
index 0262e59d35e..752c8974eb7 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSecured.tsx
+++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSecured.tsx
@@ -33,9 +33,7 @@ interface State {
}
interface Props extends DefaultInputProps {
- input: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<DefaultSpecializedInputProps>>
- >;
+ input: React.ComponentType<React.PropsWithChildren<DefaultSpecializedInputProps>>;
}
export default class InputForSecured extends React.PureComponent<Props, State> {
diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.tsx
index 6c23cbafaeb..509dc583b86 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.tsx
+++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.tsx
@@ -31,9 +31,7 @@ import InputForText from './InputForText';
function withOptions(
options: string[],
-): React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<DefaultSpecializedInputProps>>
-> {
+): React.ComponentType<React.PropsWithChildren<DefaultSpecializedInputProps>> {
return function Wrapped(props: DefaultSpecializedInputProps) {
return <InputForSingleSelectList options={options} {...props} />;
};
@@ -44,7 +42,7 @@ export default function PrimitiveInput(props: DefaultSpecializedInputProps) {
const { definition } = setting;
const typeMapping: {
[type in SettingType]?: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<DefaultSpecializedInputProps>>
+ React.PropsWithChildren<DefaultSpecializedInputProps>
>;
} = {
STRING: InputForString,
diff --git a/server/sonar-web/src/main/js/components/hoc/utils.ts b/server/sonar-web/src/main/js/components/hoc/utils.ts
index de17d1bdf59..fe06d8ac8f3 100644
--- a/server/sonar-web/src/main/js/components/hoc/utils.ts
+++ b/server/sonar-web/src/main/js/components/hoc/utils.ts
@@ -18,7 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
export function getWrappedDisplayName<P>(
- WrappedComponent: React.ComponentType<React.PropsWithChildren<React.PropsWithChildren<P>>>,
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P>>,
hocName: string,
) {
const wrappedDisplayName = WrappedComponent.displayName ?? WrappedComponent.name ?? 'Component';
diff --git a/server/sonar-web/src/main/js/components/hoc/whenLoggedIn.tsx b/server/sonar-web/src/main/js/components/hoc/whenLoggedIn.tsx
index 682f3c22ce1..5c0ae8915a5 100644
--- a/server/sonar-web/src/main/js/components/hoc/whenLoggedIn.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/whenLoggedIn.tsx
@@ -23,9 +23,7 @@ import handleRequiredAuthentication from '../../helpers/handleRequiredAuthentica
import { CurrentUser, isLoggedIn } from '../../types/users';
import { getWrappedDisplayName } from './utils';
-export function whenLoggedIn<P>(
- WrappedComponent: React.ComponentType<React.PropsWithChildren<React.PropsWithChildren<P>>>,
-) {
+export function whenLoggedIn<P>(WrappedComponent: React.ComponentType<React.PropsWithChildren<P>>) {
class Wrapper extends React.Component<P & { currentUser: CurrentUser }> {
static displayName = getWrappedDisplayName(WrappedComponent, 'whenLoggedIn');
diff --git a/server/sonar-web/src/main/js/components/hoc/withCLanguageFeature.tsx b/server/sonar-web/src/main/js/components/hoc/withCLanguageFeature.tsx
index a7eb2b41b75..b7707a554bf 100644
--- a/server/sonar-web/src/main/js/components/hoc/withCLanguageFeature.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/withCLanguageFeature.tsx
@@ -23,7 +23,7 @@ import { getWrappedDisplayName } from './utils';
export function withCLanguageFeature<P>(
WrappedComponent: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<P & { hasCLanguageFeature: boolean }>>
+ React.PropsWithChildren<P & { hasCLanguageFeature: boolean }>
>,
) {
class Wrapper extends React.Component<Omit<P, 'hasCLanguageFeature'>> {
diff --git a/server/sonar-web/src/main/js/components/hoc/withIndexationContext.tsx b/server/sonar-web/src/main/js/components/hoc/withIndexationContext.tsx
index a6e50ed6e0f..6389f1fe692 100644
--- a/server/sonar-web/src/main/js/components/hoc/withIndexationContext.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/withIndexationContext.tsx
@@ -27,9 +27,7 @@ export interface WithIndexationContextProps {
}
export default function withIndexationContext<P>(
- WrappedComponent: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<P & WithIndexationContextProps>>
- >,
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P & WithIndexationContextProps>>,
) {
return class WithIndexationContext extends React.PureComponent<
Omit<P, keyof WithIndexationContextProps>
diff --git a/server/sonar-web/src/main/js/components/hoc/withIndexationGuard.tsx b/server/sonar-web/src/main/js/components/hoc/withIndexationGuard.tsx
index 66efb6f5441..d496db7cb39 100644
--- a/server/sonar-web/src/main/js/components/hoc/withIndexationGuard.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/withIndexationGuard.tsx
@@ -25,7 +25,7 @@ export default function withIndexationGuard<P>({
Component,
showIndexationMessage,
}: {
- Component: React.ComponentType<React.PropsWithChildren<React.PropsWithChildren<P>>>;
+ Component: React.ComponentType<React.PropsWithChildren<P>>;
showIndexationMessage: (props: P) => boolean;
}) {
return function WithIndexationGuard(props: React.PropsWithChildren<P>) {
diff --git a/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx b/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx
index ccf20bab442..582b5b46e82 100644
--- a/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx
@@ -37,7 +37,7 @@ export interface WithKeyboardNavigationProps {
export default function withKeyboardNavigation<P>(
WrappedComponent: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<P & Partial<WithKeyboardNavigationProps>>>
+ React.PropsWithChildren<P & Partial<WithKeyboardNavigationProps>>
>,
) {
return class Wrapper extends React.Component<P & WithKeyboardNavigationProps> {
diff --git a/server/sonar-web/src/main/js/components/hoc/withLocation.tsx b/server/sonar-web/src/main/js/components/hoc/withLocation.tsx
index 21713420d52..2ef061c2df4 100644
--- a/server/sonar-web/src/main/js/components/hoc/withLocation.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/withLocation.tsx
@@ -21,9 +21,7 @@ import * as React from 'react';
import { Location, useLocation } from 'react-router-dom';
export default function withLocation<P>(
- WrappedComponent: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<P & { location: Location }>>
- >,
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P & { location: Location }>>,
) {
return function WithLocation(props: Omit<P, 'location'>) {
const location = useLocation();
diff --git a/server/sonar-web/src/main/js/components/hoc/withNotifications.tsx b/server/sonar-web/src/main/js/components/hoc/withNotifications.tsx
index 236a9b7a91b..344b4e04dff 100644
--- a/server/sonar-web/src/main/js/components/hoc/withNotifications.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/withNotifications.tsx
@@ -46,9 +46,7 @@ export interface WithNotificationsProps {
}
export function withNotifications<P>(
- WrappedComponent: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<P & WithNotificationsProps>>
- >,
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P & WithNotificationsProps>>,
) {
class Wrapper extends React.Component<P, State> {
mounted = false;
diff --git a/server/sonar-web/src/main/js/components/hoc/withRouter.tsx b/server/sonar-web/src/main/js/components/hoc/withRouter.tsx
index b352d94c268..0a286faffa9 100644
--- a/server/sonar-web/src/main/js/components/hoc/withRouter.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/withRouter.tsx
@@ -45,10 +45,8 @@ export interface WithRouterProps {
}
export function withRouter<P extends Partial<WithRouterProps>>(
- WrappedComponent: React.ComponentType<React.PropsWithChildren<React.PropsWithChildren<P>>>,
-): React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<Omit<P, keyof WithRouterProps>>>
-> {
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P>>,
+): React.ComponentType<React.PropsWithChildren<Omit<P, keyof WithRouterProps>>> {
function ComponentWithRouterProp(props: P) {
const router = useRouter();
const params = useParams();
@@ -57,9 +55,8 @@ export function withRouter<P extends Partial<WithRouterProps>>(
return <WrappedComponent {...props} location={location} params={params} router={router} />;
}
- (
- ComponentWithRouterProp as React.FC<React.PropsWithChildren<React.PropsWithChildren<P>>>
- ).displayName = getWrappedDisplayName(WrappedComponent, 'withRouter');
+ (ComponentWithRouterProp as React.FC<React.PropsWithChildren<P>>).displayName =
+ getWrappedDisplayName(WrappedComponent, 'withRouter');
return ComponentWithRouterProp;
}
diff --git a/server/sonar-web/src/main/js/components/icons/ProjectLinkIcon.tsx b/server/sonar-web/src/main/js/components/icons/ProjectLinkIcon.tsx
index 880f59ecc11..4c01773c226 100644
--- a/server/sonar-web/src/main/js/components/icons/ProjectLinkIcon.tsx
+++ b/server/sonar-web/src/main/js/components/icons/ProjectLinkIcon.tsx
@@ -43,9 +43,7 @@ export default function ProjectLinkIcon({
type,
...iconProps
}: IconProps & ProjectLinkIconProps) {
- const getIcon = (): FC<
- React.PropsWithChildren<React.PropsWithChildren<IconProps | MIUIIconProps>>
- > => {
+ const getIcon = (): FC<React.PropsWithChildren<IconProps | MIUIIconProps>> => {
switch (type) {
case 'issue':
return miui ? PulseIcon : BugTrackerIcon;
diff --git a/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx b/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx
index 118a54a1ef8..54870af792c 100644
--- a/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx
+++ b/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx
@@ -37,9 +37,7 @@ interface Props {
sections?: RuleDescriptionSection[];
}
-const EDUCATION_PRINCIPLES_MAP: Dict<
- React.ComponentType<React.PropsWithChildren<React.PropsWithChildren<unknown>>>
-> = {
+const EDUCATION_PRINCIPLES_MAP: Dict<React.ComponentType<React.PropsWithChildren>> = {
defense_in_depth: DefenseInDepth,
never_trust_user_input: NeverTrustUserInput,
};
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsStep.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsStep.tsx
index 162d2a742e7..d1b33805c1f 100644
--- a/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsStep.tsx
+++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsStep.tsx
@@ -37,9 +37,7 @@ const BUILD_TOOLS_WITH_NO_ADDITIONAL_OPTIONS = [
];
const BUILDTOOL_COMPONENT_MAP: {
- [x in BuildTools]: React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<LanguageProps>>
- >;
+ [x in BuildTools]: React.ComponentType<React.PropsWithChildren<LanguageProps>>;
} = {
[BuildTools.Maven]: Maven,
[BuildTools.Gradle]: Gradle,
diff --git a/server/sonar-web/src/main/js/components/workspace/WorkspaceHeader.tsx b/server/sonar-web/src/main/js/components/workspace/WorkspaceHeader.tsx
index 2d5d7af9978..86d6d169dbf 100644
--- a/server/sonar-web/src/main/js/components/workspace/WorkspaceHeader.tsx
+++ b/server/sonar-web/src/main/js/components/workspace/WorkspaceHeader.tsx
@@ -84,7 +84,7 @@ export default class WorkspaceHeader extends React.PureComponent<Props> {
}
interface WorkspaceHeaderButtonProps {
- icon: React.FC<React.PropsWithChildren<React.PropsWithChildren<IconProps>>>;
+ icon: React.FC<React.PropsWithChildren<IconProps>>;
onClick: () => void;
tooltip: string;
}
diff --git a/server/sonar-web/src/main/js/helpers/testUtils.ts b/server/sonar-web/src/main/js/helpers/testUtils.ts
index d4b9704c79a..e9002780138 100644
--- a/server/sonar-web/src/main/js/helpers/testUtils.ts
+++ b/server/sonar-web/src/main/js/helpers/testUtils.ts
@@ -20,12 +20,10 @@
import { ComponentClass, FunctionComponent } from 'react';
export type ComponentPropsType<
- T extends
- | ComponentClass
- | FunctionComponent<React.PropsWithChildren<React.PropsWithChildren<any>>>,
+ T extends ComponentClass | FunctionComponent<React.PropsWithChildren<any>>,
> = T extends ComponentClass<infer P>
? P
- : T extends FunctionComponent<React.PropsWithChildren<React.PropsWithChildren<infer P>>>
+ : T extends FunctionComponent<React.PropsWithChildren<infer P>>
? P
: never;
diff --git a/server/sonar-web/src/main/js/queries/branch.tsx b/server/sonar-web/src/main/js/queries/branch.tsx
index ffbdff3369f..31ca666967f 100644
--- a/server/sonar-web/src/main/js/queries/branch.tsx
+++ b/server/sonar-web/src/main/js/queries/branch.tsx
@@ -334,9 +334,7 @@ export function withBranchLikes<P extends { component?: Component }>(
>
>
>,
-): React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<Omit<P, 'branchLike' | 'branchLikes'>>>
-> {
+): React.ComponentType<React.PropsWithChildren<Omit<P, 'branchLike' | 'branchLikes'>>> {
return function WithBranchLike(p: P) {
const { data, isFetching } = useBranchesQuery(p.component);
return (
@@ -353,10 +351,8 @@ export function withBranchLikes<P extends { component?: Component }>(
export function withBranchStatusRefresh<
P extends { refreshBranchStatus: ReturnType<typeof useRefreshBranchStatus> },
>(
- WrappedComponent: React.ComponentType<React.PropsWithChildren<React.PropsWithChildren<P>>>,
-): React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<Omit<P, 'refreshBranchStatus'>>>
-> {
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P>>,
+): React.ComponentType<React.PropsWithChildren<Omit<P, 'refreshBranchStatus'>>> {
return function WithBranchStatusRefresh(props: P) {
const refresh = useRefreshBranchStatus();