Skip to content

Commit

Permalink
revert prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
willybrauner committed Feb 7, 2024
1 parent 2e36e30 commit f76ec81
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion apps/front/config/tasks/build-htaccess/build-htaccess.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const _createHtaccessFile = async ({ outputPath, htaccessTemplatePath }) => {
if (!templateExist) {
console.log(
"htaccess template doesn't exit. You need to create manually the template file in",
htaccessTemplatePath,
htaccessTemplatePath
)
return
}
Expand Down
2 changes: 1 addition & 1 deletion apps/front/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion apps/front/prerender/__tests__/ManifestParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ it("should return a list of assets by type", () => {

extensions.forEach((e) => {
expect(
assetsByType[e].every((f) => f.split(".")[f.split(".").length - 1] === e),
assetsByType[e].every((f) => f.split(".")[f.split(".").length - 1] === e)
).toBe(true)
})
})
Expand Down
6 changes: 3 additions & 3 deletions apps/front/prerender/exe-prerender-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ app.get("/generate", async (req, res) => {
app.listen(port, () => {
console.log("")
console.log(
`> Generate all pages ${chalk.blue(`http://localhost:${port}/generate`)}`,
`> Generate all pages ${chalk.blue(`http://localhost:${port}/generate`)}`
)
console.log(
`> Generate specific page ${chalk.blue(
`http://localhost:${port}/generate?url=/my-page/url`,
)}`,
`http://localhost:${port}/generate?url=/my-page/url`
)}`
)
})
2 changes: 1 addition & 1 deletion apps/front/prerender/helpers/ManifestParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class ManifestParser {
...(jsonManifest[b]?.css || []),
]
: a,
[],
[]
)
.filter((e) => e)

Expand Down
2 changes: 1 addition & 1 deletion apps/front/prerender/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const createHtmlFile = async (
urls: string[],
url: string,
outDir: string,
dom: ReactElement<any, string | JSXElementConstructor<any>>,
dom: ReactElement<any, string | JSXElementConstructor<any>>
): Promise<void> => {
// Prepare file
if (isRouteIndex(url, urls)) url = `${url}/index`
Expand Down
6 changes: 3 additions & 3 deletions apps/front/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const isSSL = protocol === "https"
if (isSSL) {
if (!(await mfs.fileExists("key.pem")) || !(await mfs.fileExists("cert.pem"))) {
console.error(
"You need to generate a key and a cert file with openssl in the apps/front/ directory. Follow the README documentation 'setup-local-ssl'.",
"You need to generate a key and a cert file with openssl in the apps/front/ directory. Follow the README documentation 'setup-local-ssl'."
)
process.exit(1)
}
Expand Down Expand Up @@ -61,7 +61,7 @@ const isSSL = protocol === "https"
try {
// Transforms the ESM source code to be usable in Node.js
const { render } = await vite.ssrLoadModule(
`${config.srcDir}/server/index-server.tsx`,
`${config.srcDir}/server/index-server.tsx`
)
// Get react-dom from the render method
const dom = await render(req.originalUrl, devScripts, false)
Expand Down Expand Up @@ -107,6 +107,6 @@ const isSSL = protocol === "https"
* Let's go!
*/
;(isProduction ? createProdServer : createDevServer)().then(({ app, sslServer }) =>
(sslServer ?? app).listen(port),
(sslServer ?? app).listen(port)
)
})()
2 changes: 1 addition & 1 deletion apps/front/src/components/baseButton/BaseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function BaseButton(props: IProps, ref: MutableRefObject<any>) {
css.root,
props.className,
css[`root_${props.type}`],
css[`root_${props.tag}`],
css[`root_${props.tag}`]
)

/**
Expand Down
2 changes: 1 addition & 1 deletion apps/front/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ hydrateRoot(
<GlobalDataContext.Provider value={window["__GLOBAL_DATA__"]}>
<App />
</GlobalDataContext.Provider>
</Router>,
</Router>
)
12 changes: 6 additions & 6 deletions apps/front/src/libs/components/cookiesBanner/CookiesBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function CookiesBanner(props: IProps) {
if (injectScriptTags) {
if ($gTagManagerScript || $gTagManagerDataLayerScript || $gTagManagerNoScript) {
log(
"$gTagManagerNoScript or $gTagManagerNoScript already exist in DOM, NOT create new scripts. return. ",
"$gTagManagerNoScript or $gTagManagerNoScript already exist in DOM, NOT create new scripts. return. "
)
return
}
Expand All @@ -130,7 +130,7 @@ export function CookiesBanner(props: IProps) {
$gTagManagerNoScript,
// auto generated when script is injected in DOM, we remove it too.
document.querySelector(
`script[src="https://www.googletagmanager.com/gtm.js?id=${trackingID}"]`,
`script[src="https://www.googletagmanager.com/gtm.js?id=${trackingID}"]`
),
]

Expand All @@ -147,7 +147,7 @@ export function CookiesBanner(props: IProps) {
*/
const googleAnalyticsInjection = (
injectScriptTags: boolean,
trackingID: string,
trackingID: string
): void => {
if (!trackingID) return

Expand Down Expand Up @@ -196,7 +196,7 @@ export function CookiesBanner(props: IProps) {
$tracking,
// auto generated when script is injected in DOM, we remove it too.
document.querySelector(
'script[src$="https://www.google-analytics.com/analytics.js"]',
'script[src$="https://www.google-analytics.com/analytics.js"]'
),
]

Expand Down Expand Up @@ -278,7 +278,7 @@ export function CookiesBanner(props: IProps) {
show: boolean = true,
el = rootRef?.current as HTMLElement,
modifier = css.root_show,
modifierHide = css.root_hide,
modifierHide = css.root_hide
): void => {
if (show) {
el?.classList?.add(modifier)
Expand Down Expand Up @@ -317,7 +317,7 @@ export function CookiesBanner(props: IProps) {
} else {
log(
"init > localStorageChoiceExist() doesnt exist, anim show component",
localStorageChoiceExist(),
localStorageChoiceExist()
)
// add show class
CookiesBannerService.show()
Expand Down
6 changes: 3 additions & 3 deletions apps/front/src/libs/dom/MetaManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class MetasManager {
*/
private static selectMetaValue(
customMetasValue: TMetaTags<string>,
pType: string,
pType: string
): string {
return MetasManager.checkValue(customMetasValue?.[pType]) || ""
}
Expand Down Expand Up @@ -144,7 +144,7 @@ export class MetasManager {
newTagElement.setAttribute(property.attr, metaValue)
newTagElement.setAttribute(MetasManager.AUTO_GENERATE_ATTR, "")
const autoGeneratedMetaElement = document.head.querySelectorAll(
`*[${MetasManager.AUTO_GENERATE_ATTR}]`,
`*[${MetasManager.AUTO_GENERATE_ATTR}]`
)

// if there is no meta auto-generated, insert after <title>
Expand All @@ -159,7 +159,7 @@ export class MetasManager {
autoGeneratedMetaElement[autoGeneratedMetaElement.length - 1]
lastAutoGeneratedMeta.parentNode.insertBefore(
newTagElement,
lastAutoGeneratedMeta.nextSibling,
lastAutoGeneratedMeta.nextSibling
)
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion apps/front/src/libs/dom/convertRemToPx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const _convertFontSizeCssVarToPx = (cssUnitValue: string): number => {

if (isCalc) {
const viewportReferenceDesktopHeight = parseFloat(
_getRootCssVariable("--viewport-reference-desktop-height"),
_getRootCssVariable("--viewport-reference-desktop-height")
)
return (1 / viewportReferenceDesktopHeight) * window.innerHeight
}
Expand Down
2 changes: 1 addition & 1 deletion apps/front/src/libs/hooks/useIntersectionObserver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface Args extends IntersectionObserverInit {
*/
function useIntersectionObserver(
elementRef: RefObject<Element>,
{ threshold = 0, root = null, rootMargin = "0%", freezeOnceVisible = false }: Args,
{ threshold = 0, root = null, rootMargin = "0%", freezeOnceVisible = false }: Args
): IntersectionObserverEntry | undefined {
const [entry, setEntry] = useState<IntersectionObserverEntry>()

Expand Down
2 changes: 1 addition & 1 deletion apps/front/src/libs/hooks/useIsLandscapeScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useEffect, useState } from "react"
*/
export function useIsLandscapeScreen(): boolean {
const [isLandscapeScreen, setIsLandscapeScreen] = useState<boolean>(
window.innerWidth > window.innerHeight,
window.innerWidth > window.innerHeight
)

const handler = () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/front/src/libs/hooks/useMinWidth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ import { useMatchMedia } from "~/libs/hooks/useMatchMedia"
*/
export const useIsMinWidth = (breakpoint: TBreakpoint): boolean => {
return browserOnly(() =>
useMatchMedia(`(min-width:${getBreakpointCssVariable(breakpoint)})`),
useMatchMedia(`(min-width:${getBreakpointCssVariable(breakpoint)})`)
)
}
2 changes: 1 addition & 1 deletion apps/front/src/libs/hooks/useWindowSize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const useWindowSize = (): { width: number; height: number } => {
const [size, setSize] = useState(
isBrowser()
? { width: window.innerWidth, height: window.innerHeight }
: { width: null, height: null },
: { width: null, height: null }
)
useEffect(() => {
const handler = () => {
Expand Down
6 changes: 5 additions & 1 deletion apps/front/src/server/helpers/CherScripts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ export const ScriptTag = ({ tag, attr }: TScript): JSX.Element => {
}

export const CherScripts = ({ scripts }: { scripts: TScript[] }): JSX.Element => (
<>{scripts?.map((script, i) => <ScriptTag key={i} {...script} />)}</>
<>
{scripts?.map((script, i) => (
<ScriptTag key={i} {...script} />
))}
</>
)

0 comments on commit f76ec81

Please sign in to comment.