Skip to content

Commit e3cec22

Browse files
authored
chore: add no-unnecessary-type-conversion (#2029)
2 parents 76cde88 + dd11673 commit e3cec22

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

packages/pluggableWidgets/rating-web/src/StarRating.editorPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function preview(props: StarRatingPreviewProps): ReactElement {
2828
fullIcon={fullIcon}
2929
maximumValue={props.maximumStars ?? 5}
3030
style={parseStyle(props.style)}
31-
value={Number(props.maximumStars ?? 5) - 1}
31+
value={(props.maximumStars ?? 5) - 1}
3232
/>
3333
);
3434
}

packages/pluggableWidgets/rating-web/src/components/Rating.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ export function Rating(props: RatingProps): ReactElement {
9494
role="radio"
9595
tabIndex={index === Math.max(props.value - 1, 0) ? 0 : -1}
9696
>
97-
{Number(currentIndex) <= props.value ? (
97+
{currentIndex <= props.value ? (
9898
props.fullIcon
99-
) : hover && currentIndex <= Number(hover) ? (
99+
) : hover && currentIndex <= hover ? (
100100
<div className="rating-item-hover">{props.fullIcon}</div>
101101
) : (
102102
props.emptyIcon

packages/pluggableWidgets/rich-text-web/.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/pluggableWidgets/rich-text-web/src/components/CustomToolbars/presets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function defineBasicGroups(widgetProps: Partial<RichTextContainerProps>): toolba
1313
const enabledGroups: Array<toolbarContentType | undefined> = Object.entries(widgetProps).map(([prop, enabled]) => {
1414
if (Object.hasOwn(TOOLBAR_GROUP, prop) && enabled) {
1515
return {
16-
children: TOOLBAR_GROUP[prop.toString()]
16+
children: TOOLBAR_GROUP[prop]
1717
};
1818
} else {
1919
return undefined;

packages/shared/eslint-config-web-widgets/widget-ts.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export default tseslint.config(
154154
"@typescript-eslint/no-empty-object-type": "warn",
155155
"@typescript-eslint/no-unsafe-function-type": "warn",
156156
"@typescript-eslint/no-wrapper-object-types": "warn",
157+
"@typescript-eslint/no-unnecessary-type-conversion": "error",
157158

158159
"@typescript-eslint/ban-ts-comment": "warn",
159160
"@typescript-eslint/camelcase": "off",

0 commit comments

Comments
 (0)