Merged in chore/eslint-curly-braces (pull request #3304)

Chore/eslint curly braces

* Add eslint rule for curly braces

* run eslint --fix for all files


Approved-by: Linus Flood
This commit is contained in:
Joakim Jäderberg
2025-12-08 07:56:21 +00:00
parent 5986828580
commit de4b3c1c3c
54 changed files with 139 additions and 104 deletions

View File

@@ -18,7 +18,7 @@ export function AlreadyLinkedError() {
<SASModal>
<MaterialIcon
icon="check_circle"
color={"Icon/Feedback/Success"}
color="Icon/Feedback/Success"
isFilled
size={64}
/>
@@ -43,9 +43,9 @@ export function AlreadyLinkedError() {
<Typography variant="Body/Paragraph/mdBold">
<ButtonLink
href={partnerSas[lang]}
variant={"Tertiary"}
color={"Primary"}
size={"Large"}
variant="Tertiary"
color="Primary"
size="Large"
>
{intl.formatMessage({
id: "linkEuroBonusAccount.viewLinkedAccountsButton",

View File

@@ -54,7 +54,7 @@ export function LinkAccountForm({
<form onSubmit={handleSubmit} className={styles.form}>
<div className={styles.titles}>
<Image
alt={"Scandic ❤️ SAS"}
alt="Scandic ❤️ SAS"
height={25}
width={182}
src="/_static/img/partner/sas/sas-campaign-logo.png"

View File

@@ -78,9 +78,8 @@ export default function GlobalError({
<p>
<strong>
{
"While we're working hard to fix it, you can always give us a call:"
}
While we&apos;re working hard to fix it, you can always give us a
call:
</strong>
</p>

View File

@@ -32,7 +32,7 @@ export default function Filter({
<form className={styles.filterForm}>
<DeprecatedSelect
items={countryFilters}
defaultSelectedKey={""}
defaultSelectedKey=""
label={intl.formatMessage({
id: "common.country",
defaultMessage: "Country",
@@ -46,7 +46,7 @@ export default function Filter({
/>
<DeprecatedSelect
items={cityFilters}
defaultSelectedKey={""}
defaultSelectedKey=""
label={intl.formatMessage({
id: "jobylonFeed.cityFilterLabel",
defaultMessage: "Location (shown in local language)",
@@ -60,7 +60,7 @@ export default function Filter({
/>
<DeprecatedSelect
items={departmentFilters}
defaultSelectedKey={""}
defaultSelectedKey=""
label={intl.formatMessage({
id: "jobylonFeed.departmentFilterLabel",
defaultMessage: "Hotel or office",
@@ -74,7 +74,7 @@ export default function Filter({
/>
<DeprecatedSelect
items={categoryFilters}
defaultSelectedKey={""}
defaultSelectedKey=""
label={intl.formatMessage({
id: "jobylonFeed.categoryFilterLabel",
defaultMessage: "Category",

View File

@@ -157,8 +157,8 @@ export default function OverviewTableClient({
<div>
<div className={styles.mobileColumns}>
<div className={styles.columnHeaderContainer}>
<MobileColumnHeader column={"A"} />
<MobileColumnHeader column={"B"} />
<MobileColumnHeader column="A" />
<MobileColumnHeader column="B" />
</div>
<RewardList
levels={[

View File

@@ -40,7 +40,7 @@ export default function LargeTable({
return (
<tr key={key + idx} className={styles.tr}>
<th scope={"row"} className={styles.rewardTh}>
<th scope="row" className={styles.rewardTh}>
<RewardTableHeader name={label} description={description} />
</th>
{levels.map((level, idx) => {
@@ -71,7 +71,7 @@ function RewardTableHeader({ name, description }: RewardTableHeaderProps) {
<details className={styles.details}>
<summary className={styles.summary}>
<hgroup className={styles.rewardHeader}>
<Title as="h4" level="h2" textTransform={"regular"}>
<Title as="h4" level="h2" textTransform="regular">
{name}
</Title>
<span className={styles.chevron}>

View File

@@ -19,7 +19,7 @@ export default function RewardCard({
<details className={styles.details}>
<summary className={styles.summary}>
<hgroup className={styles.rewardCardHeader}>
<Title as="h4" level="h2" textTransform={"regular"}>
<Title as="h4" level="h2" textTransform="regular">
{title}
</Title>
<span className={styles.chevron}>

View File

@@ -11,7 +11,7 @@ export default function YourLevel() {
className={styles.script}
color="peach80"
type="two"
textAlign={"center"}
textAlign="center"
>
{intl.formatMessage({
id: "overviewTable.yourLevel",

View File

@@ -27,8 +27,8 @@ export default async function PointsOverview({
link={link}
preamble={subtitle}
title={title}
headingAs={"h3"}
headingLevel={"h1"}
headingAs="h3"
headingLevel="h1"
/>
<div className={styles.membershipCardsContainer}>
<PointsToSpendCard user={user} />

View File

@@ -43,7 +43,7 @@ export function DestinationSearchForm({
handlePressEnter={() => {
void 0
}}
inputName={"destinationSearch"}
inputName="destinationSearch"
onSelect={(item) => {
if (!item.url) {
Sentry.captureMessage(

View File

@@ -210,7 +210,7 @@ export default function ConfirmationStep({
onChange={(method) => {
trackUpdatePaymentMethod({ method })
}}
formName={"paymentMethod"}
formName="paymentMethod"
/>
</>
)}

View File

@@ -28,7 +28,7 @@ export default function DeliveryMethodStep() {
</Typography>
<Select
name="deliveryTime"
label={""}
label=""
items={deliveryTimeOptions}
registerOptions={{ required: true }}
isNestedInModal

View File

@@ -124,7 +124,7 @@ export default function Room({ booking, roomNr, user }: RoomProps) {
<div className={styles.roomHeader}>
{isCancelled ? (
<IconChip
color={"red"}
color="red"
icon={
<MaterialIcon
icon="cancel"

View File

@@ -40,7 +40,7 @@ export default function SingleRoom({ user }: RoomProps) {
if (!roomNumber) {
return (
<div className={styles.room}>
<SkeletonShimmer width={"200px"} height="30px" />
<SkeletonShimmer width="200px" height="30px" />
<SkeletonShimmer width="100%" height="750px" />
</div>
)

View File

@@ -8,15 +8,15 @@ export function MyStaySkeleton() {
return (
<div className={styles.content}>
<div className={styles.headerSkeleton}>
<SkeletonShimmer width={"100px"} height="20px" />
<SkeletonShimmer width={"450px"} height="50px" />
<SkeletonShimmer width={"200px"} height="30px" />
<SkeletonShimmer width="100px" height="20px" />
<SkeletonShimmer width="450px" height="50px" />
<SkeletonShimmer width="200px" height="30px" />
</div>
<div className={styles.cardSkeleton}>
<SkeletonShimmer width="590px" height="380px" />
</div>
<div className={styles.section}>
<SkeletonShimmer width={"200px"} height="30px" />
<SkeletonShimmer width="200px" height="30px" />
<div className={styles.ancillariesSkeleton}>
<SkeletonShimmer width="280px" height="200px" />
<SkeletonShimmer width="280px" height="200px" />
@@ -26,7 +26,7 @@ export function MyStaySkeleton() {
</div>
</div>
<div className={styles.section}>
<SkeletonShimmer width={"200px"} height="30px" />
<SkeletonShimmer width="200px" height="30px" />
<div>
<SkeletonShimmer width="100%" height="700px" />
</div>

View File

@@ -41,7 +41,7 @@ export default function LevelProgressModal({
<Modal
className={styles.dialog}
trigger={
<IconButton theme={"Black"}>
<IconButton theme="Black">
<MaterialIcon
className={styles.infoButton}
icon="info"

View File

@@ -15,7 +15,7 @@ function PaginationButton({
}: React.PropsWithChildren<PaginationButtonProps>) {
return (
<button
type={"button"}
type="button"
disabled={disabled}
onClick={handleClick}
className={`${styles.paginationButton} ${isActive ? styles.paginationButtonActive : ""}`}

View File

@@ -171,7 +171,7 @@ export default function BookedRoomSidePeekContent({
<div className={styles.roomHeader}>
{isCancelled ? (
<IconChip
color={"red"}
color="red"
icon={
<MaterialIcon
icon="cancel"

View File

@@ -26,21 +26,21 @@ export default async function JoinLoyaltyContact({
<section className={styles.joinLoyaltyContainer}>
<article className={styles.wrapper}>
{block.title ? (
<Typography variant={"Title/Subtitle/md"}>
<Typography variant="Title/Subtitle/md">
<h4 className={styles.title}>{block.title}</h4>
</Typography>
) : null}
<ScandicFriends color="red" />
{block.preamble ? (
<Typography variant={"Body/Paragraph/mdRegular"}>
<Typography variant="Body/Paragraph/mdRegular">
<p className={styles.preamble}>{block.preamble}</p>
</Typography>
) : null}
{block.button ? (
<Typography variant={"Body/Paragraph/mdBold"}>
<Typography variant="Body/Paragraph/mdBold">
<ButtonLink
className={styles.button}
size={"Small"}
size="Small"
wrapping
href={block.button.href}
target={block.button.openInNewTab ? "_blank" : "_self"}
@@ -50,7 +50,7 @@ export default async function JoinLoyaltyContact({
</Typography>
) : null}
<section className={styles.loginContainer}>
<Typography variant={"Body/Paragraph/mdRegular"}>
<Typography variant="Body/Paragraph/mdRegular">
<p>
{intl.formatMessage({
id: "loyalty.alreadyFriend",

View File

@@ -48,6 +48,14 @@ export default defineConfig([
"no-console": "warn",
"no-unused-vars": "off",
"react/function-component-definition": "error",
"react/jsx-curly-brace-presence": [
"error",
{
props: "never",
children: "ignore",
propElementValues: "always",
},
],
"import/no-relative-packages": "error",
"simple-import-sort/imports": [
"warn",

View File

@@ -6,8 +6,8 @@
"scripts": {
"build": "next build",
"dev": "NODE_OPTIONS=--openssl-legacy-provider PORT=3000 NEXT_PUBLIC_PORT=3000 next dev --turbo",
"lint": "next typegen && eslint --max-warnings 0 . && tsgo --noEmit",
"lint:fix": "next typegen && eslint --fix --max-warnings 0 . && tsgo --noEmit",
"lint": "next typegen && eslint --max-warnings 0 .",
"lint:fix": "next typegen && eslint --fix --max-warnings 0 .",
"start": "node .next/standalone/server.js",
"test:setup": "yarn build && yarn start",
"test:e2e": "playwright test",