Skip to content

Commit

Permalink
fmt: stop using preserve params in prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Nov 13, 2024
1 parent 3e5ce30 commit 6dd34bd
Show file tree
Hide file tree
Showing 19 changed files with 2,763 additions and 2,794 deletions.
1 change: 0 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"useTabs": false,
"semi": true,
"singleQuote": false,
"quoteProps": "preserve",
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "avoid"
Expand Down
12 changes: 6 additions & 6 deletions src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export const App = memo(() => {
return [
<FourOhFour />,
id<HeaderOptions>({
"position": "sticky",
"isRetracted": false,
position: "sticky",
isRetracted: false,
}),
] as const;
}, [route, documentationStickyHeaderRef.current]);
Expand All @@ -90,7 +90,7 @@ export const App = memo(() => {
return (
<GlTemplate
classes={{
"headerWrapper": classes.header,
headerWrapper: classes.header,
}}
header={
<div ref={headerRef}>
Expand All @@ -116,9 +116,9 @@ export const App = memo(() => {
});

const useStyles = tss.create({
"header": {
"zIndex": 4000,
"position": "fixed",
header: {
zIndex: 4000,
position: "fixed",
},
});

Expand Down
46 changes: 23 additions & 23 deletions src/App/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const AppHeader = memo((props: Props) => {
} = useDomRect();

const { classes, theme } = useStyles({
"isRetracted": isRetracted ?? false,
isRetracted: isRetracted ?? false,
headerHeight,
});

Expand All @@ -47,7 +47,7 @@ export const AppHeader = memo((props: Props) => {
>
{t("platform")}
</Text>,
<div key={1} style={{ "width": theme.spacing(3) }} />,
<div key={1} style={{ width: theme.spacing(3) }} />,
<Text
key={2}
typo="section heading"
Expand All @@ -68,26 +68,26 @@ export const AppHeader = memo((props: Props) => {
}
links={[
{
"label": t("trainings and tutorials"),
label: t("trainings and tutorials"),
...routes.documentation().link,
},
{
"label": t("the onyxia datalab"),
"href": "https://datalab.sspcloud.fr",
label: t("the onyxia datalab"),
href: "https://datalab.sspcloud.fr",
},
{
"label": t("contribute"),
"href": "https://github.com/InseeFrLab/www.sspcloud.fr",
label: t("contribute"),
href: "https://github.com/InseeFrLab/www.sspcloud.fr",
},
]}
customItemEnd={{
"behaviorOnSmallDevice": "normal",
"item": (
behaviorOnSmallDevice: "normal",
item: (
<>
<GlobalStyles
styles={{
"#language-menu": {
"zIndex": 4001,
zIndex: 4001,
},
}}
/>
Expand All @@ -99,8 +99,8 @@ export const AppHeader = memo((props: Props) => {
onLanguageChange={setLang}
variant="big"
languagesPrettyPrint={{
"en": "English",
"fr": "Français",
en: "English",
fr: "Français",
}}
/>
</>
Expand All @@ -115,21 +115,21 @@ export const AppHeader = memo((props: Props) => {
const useStyles = tss
.withParams<{ isRetracted: boolean; headerHeight: number }>()
.create(({ isRetracted, headerHeight }) => ({
"root": {
"transition": "margin-top 250ms",
root: {
transition: "margin-top 250ms",
"margin-top": isRetracted ? -headerHeight : 0,
},
"titleWrapper": {
"display": "flex",
"justifyContent": "center",
"alignItems": "center",
"textDecoration": "none",
titleWrapper: {
display: "flex",
justifyContent: "center",
alignItems: "center",
textDecoration: "none",
},
"sspCloudText": {
"fontWeight": 500,
sspCloudText: {
fontWeight: 500,
},
"communityText": {
"fontWeight": 600,
communityText: {
fontWeight: 600,
},
}));

Expand Down
24 changes: 12 additions & 12 deletions src/bin/link_inhouse_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ const execYarnLink = (params: { targetModuleName?: string; cwd: string }) => {

execSync(cmd, {
cwd,
"env": {
env: {
...process.env,
"HOME": yarnHomeDirPath,
HOME: yarnHomeDirPath,
},
});
};
Expand All @@ -131,12 +131,12 @@ commonThirdPartyDeps.forEach(commonThirdPartyDep => {
],
);

execYarnLink({ "cwd": localInstallPath });
execYarnLink({ cwd: localInstallPath });

inHouseModuleNames.forEach(inHouseModuleName =>
execYarnLink({
"targetModuleName": commonThirdPartyDep,
"cwd": pathJoin(webAppProjectRootDirPath, "..", inHouseModuleName),
targetModuleName: commonThirdPartyDep,
cwd: pathJoin(webAppProjectRootDirPath, "..", inHouseModuleName),
}),
);
});
Expand All @@ -163,8 +163,8 @@ inHouseModuleNames.forEach(inHouseModuleName => {

return {
...packageJsonParsed,
"main": packageJsonParsed["main"].replace(/^dist\//, ""),
"types": packageJsonParsed["types"].replace(/^dist\//, ""),
main: packageJsonParsed["main"].replace(/^dist\//, ""),
types: packageJsonParsed["types"].replace(/^dist\//, ""),
};
})(),
null,
Expand All @@ -177,7 +177,7 @@ inHouseModuleNames.forEach(inHouseModuleName => {

inHouseModuleNames.forEach(inHouseModuleName =>
execYarnLink({
"cwd": pathJoin(webAppProjectRootDirPath, "..", inHouseModuleName, "dist"),
cwd: pathJoin(webAppProjectRootDirPath, "..", inHouseModuleName, "dist"),
}),
);

Expand All @@ -190,8 +190,8 @@ inHouseModuleNames.forEach(inHouseModuleNameOuter =>
)
.forEach(inHouseModuleNameInner =>
execYarnLink({
"targetModuleName": inHouseModuleNameInner,
"cwd": pathJoin(webAppProjectRootDirPath, "..", inHouseModuleNameOuter),
targetModuleName: inHouseModuleNameInner,
cwd: pathJoin(webAppProjectRootDirPath, "..", inHouseModuleNameOuter),
}),
),
);
Expand All @@ -200,7 +200,7 @@ console.log("=== Linking in house dependencies in web app ===");

inHouseModuleNames.forEach(inHouseModuleName => {
execYarnLink({
"targetModuleName": inHouseModuleName,
"cwd": webAppProjectRootDirPath,
targetModuleName: inHouseModuleName,
cwd: webAppProjectRootDirPath,
});
});
8 changes: 4 additions & 4 deletions src/bin/update_educational_resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ async function main(params: {
const { educationalResource } = params;

await updateEducationalResources({
"update": ({ currentEducationalResources }) =>
update: ({ currentEducationalResources }) =>
Promise.resolve({
"newEducationalResources": (() => {
newEducationalResources: (() => {
const toReplace = currentEducationalResources.find(({ name }) =>
areSameLocalizedString(name, educationalResource.name),
);
Expand All @@ -72,7 +72,7 @@ async function main(params: {

function areSameLocalizedString(a: LocalizedString, b: LocalizedString) {
const toObj = (locStr: LocalizedString): Exclude<LocalizedString, string> =>
typeof locStr === "string" ? { "en": locStr, "fr": locStr } : locStr;
typeof locStr === "string" ? { en: locStr, fr: locStr } : locStr;

const aObj = toObj(a);
const bObj = toObj(b);
Expand All @@ -82,7 +82,7 @@ function areSameLocalizedString(a: LocalizedString, b: LocalizedString) {

if (require.main === module) {
main({
"educationalResource": JSON.parse(
educationalResource: JSON.parse(
fs.readFileSync(process.argv[2]).toString("utf8"),
),
});
Expand Down
11 changes: 5 additions & 6 deletions src/bin/validate_educational_resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,22 @@ export function validateEducationalResources(params: {
)
) {
validateEducationalResources({
"educationalResourceOrEducationalResourceDirectories":
educationalResourceOrEducationalResourceDirectories:
educationalResourceOrEducationalResourceDirectory.parts,
});

return;
}

validateEducationalResource({
"educationalResource": educationalResourceOrEducationalResourceDirectory,
educationalResource: educationalResourceOrEducationalResourceDirectory,
});

languages.forEach(language => {
const { checkNameUniqueness } = checkNameUniquenessByLanguage[language];

const { resolveLocalizedString } = createResolveLocalizedString({
"currentLanguage": language,
currentLanguage: language,
fallbackLanguage,
});

Expand Down Expand Up @@ -160,7 +160,7 @@ if (require.main === module) {
const destFilePath = pathJoin(dirPath, "educationalResources_tmp.ts");

makeItNodeRunnable({
"srcFilePath": pathJoin(dirPath, "educationalResources.ts"),
srcFilePath: pathJoin(dirPath, "educationalResources.ts"),
destFilePath,
});

Expand All @@ -171,8 +171,7 @@ if (require.main === module) {
educationalResources: (EducationalResourceDirectory | EducationalResource)[];
}) => {
validateEducationalResources({
"educationalResourceOrEducationalResourceDirectories":
educationalResources,
educationalResourceOrEducationalResourceDirectories: educationalResources,
});

fs.unlinkSync(destFilePath);
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/getFormattedDate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type { Language } from "./Language";

const getFormatByLng = (isSameYear: boolean) => ({
/* spell-checker: disable */
"fr": `dddd Do MMMM${isSameYear ? "" : " YYYY"}`,
"en": `dddd, MMMM Do${isSameYear ? "" : " YYYY"}`,
fr: `dddd Do MMMM${isSameYear ? "" : " YYYY"}`,
en: `dddd, MMMM Do${isSameYear ? "" : " YYYY"}`,
/* spell-checker: enable */
});

Expand Down
Loading

0 comments on commit 6dd34bd

Please sign in to comment.