Merged in fix/3697-prettier-configs (pull request #3396)

fix(SW-3691): Setup one prettier config for whole repo

* Setup prettierrc in root and remove other configs


Approved-by: Joakim Jäderberg
Approved-by: Linus Flood
This commit is contained in:
Rasmus Langvad
2026-01-07 12:45:50 +00:00
parent 932413412b
commit d0546926a9
500 changed files with 18367 additions and 18419 deletions

View File

@@ -1,4 +1,4 @@
import { ImageLoaderProps } from 'next/image'
import { ImageLoaderProps } from "next/image"
export const imageLoader =
({
@@ -9,18 +9,18 @@ export const imageLoader =
}) =>
({ quality, src, width }: ImageLoaderProps) => {
const isAbsoluteUrl =
src.startsWith('https://') || src.startsWith('http://')
const hasQS = src.indexOf('?') !== -1
src.startsWith("https://") || src.startsWith("http://")
const hasQS = src.indexOf("?") !== -1
if (
dimensions &&
isLargerThanAspectRatio(dimensions, '3:2') &&
isLargerThanAspectRatio(dimensions, "3:2") &&
width < dimensions.width
) {
// If image is wider than 3:2, compensate for low height when rendering in a 3:2 container
const scale = width / dimensions.width
const minWidthFor32Aspect =
dimensions.height * scale * aspectRatios['3:2'] * 2
dimensions.height * scale * aspectRatios["3:2"] * 2
width = Math.max(minWidthFor32Aspect, width)
}
@@ -33,14 +33,14 @@ export const imageLoader =
width = roundToNearest(width, 10)
if (isAbsoluteUrl) {
return `https://img.scandichotels.com/.netlify/images?url=${src}&w=${width}${quality ? '&q=' + quality : ''}`
return `https://img.scandichotels.com/.netlify/images?url=${src}&w=${width}${quality ? "&q=" + quality : ""}`
}
return `${src}${hasQS ? '&' : '?'}w=${width}${quality ? '&q=' + quality : ''}`
return `${src}${hasQS ? "&" : "?"}w=${width}${quality ? "&q=" + quality : ""}`
}
const aspectRatios = {
'3:2': 3 / 2,
"3:2": 3 / 2,
}
function isLargerThanAspectRatio(
dimensions: {