From aa73d89aa03a2d42f025b8a2f80164e09faa7763 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Tue, 26 Nov 2024 12:53:42 +0100 Subject: [PATCH] chore: format code with prettier 3.4 --- .github/ISSUE_TEMPLATE/bug_report.md | 14 +- .github/ISSUE_TEMPLATE/cycle_project.md | 6 +- README.md | 12 +- adminSiteClient/Forms.tsx | 4 +- baker/DeployUtils.ts | 4 +- baker/GrapherBaker.tsx | 2 +- .../1729763649580-SetYAxisMinDefaultToZero.ts | 4 +- db/readme.md | 4 +- devTools/fonts/README.md | 6 +- devTools/graphersToGit/readme.md | 6 +- devTools/regionsUpdater/readme.md | 16 +- devTools/tsconfigs/readme.md | 18 +- devTools/wayback/readme.md | 6 +- docs/browser-support.md | 60 +-- docs/docker-compose-mysql.md | 14 +- docs/local-typescript-setup.md | 4 +- functions/README.md | 20 +- gitCms/readme.md | 22 +- ops/buildkite/README.md | 6 +- packages/@ourworldindata/core-table/readme.md | 10 +- .../explorer/src/gridLang/GridCell.ts | 2 +- .../explorer/src/urlMigrations/readme.md | 8 +- packages/@ourworldindata/grapher/readme.md | 6 +- .../grapher/src/axis/AxisViews.tsx | 2 +- .../grapher/src/core/Grapher.tsx | 2 +- .../grapher/src/facetChart/readme.md | 14 +- .../grapher/src/mapCharts/MapTooltip.tsx | 2 +- .../src/scatterCharts/ScatterPlotChart.tsx | 2 +- .../grapher/src/schema/README.md | 14 +- .../src/stackedCharts/MarimekkoChart.tsx | 5 +- .../grapher/src/tooltip/TooltipContents.tsx | 2 +- .../utils/src/persistable/readme.md | 16 +- public/fonts.css | 360 +++++++++--------- site/css/sidebar.scss | 3 +- 34 files changed, 339 insertions(+), 337 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 185f9934237..83017e284d6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -31,16 +31,16 @@ If applicable, add screenshots to help explain your problem. For desktop, provide: -- OS: [e.g. iOS] -- Browser [e.g. chrome, safari] -- Version [e.g. 22] +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] For smartphone, instead provide: -- Device: [e.g. iPhone6] -- OS: [e.g. iOS8.1] -- Browser [e.g. stock browser, safari] -- Version [e.g. 22] +- Device: [e.g. iPhone6] +- OS: [e.g. iOS8.1] +- Browser [e.g. stock browser, safari] +- Version [e.g. 22] ## Additional context diff --git a/.github/ISSUE_TEMPLATE/cycle_project.md b/.github/ISSUE_TEMPLATE/cycle_project.md index 7744fcc981a..9c38fef6cc5 100644 --- a/.github/ISSUE_TEMPLATE/cycle_project.md +++ b/.github/ISSUE_TEMPLATE/cycle_project.md @@ -18,14 +18,14 @@ Summarize what our solution is supposed to look like. **Must do** -- [ ] Technical steps that are necessary for this project +- [ ] Technical steps that are necessary for this project **Could do** -- [ ] Nice to have steps +- [ ] Nice to have steps **Won't do** -- [ ] Items we considered but that are explicitly not part of this cycle +- [ ] Items we considered but that are explicitly not part of this cycle ## Technical notes diff --git a/README.md b/README.md index 21fa8b604cf..bce7fa8ce2c 100644 --- a/README.md +++ b/README.md @@ -42,9 +42,9 @@ Each explorer can be configured via a [panel](explorerAdminServer/) in the admin ### Grapher Admin -- A [client-side](adminSiteClient/) project that provides a user interface for configuring graphers, explorers, and managing and uploading data. +- A [client-side](adminSiteClient/) project that provides a user interface for configuring graphers, explorers, and managing and uploading data. -- A [server-side](adminSiteServer/) project that manages the MySQL database used by graphers. +- A [server-side](adminSiteServer/) project that manages the MySQL database used by graphers. ### [Baker](baker/) @@ -76,10 +76,10 @@ The following is an excerpt explaining the origin of this repo and what the alte > > Using our own system has very important advantages: > -> - **Integration with our global development database**: Our database of global development metrics is integrated into our visualization tool so that when we add and update empirical data the visualizations are all updated. (In contrast to this, a pre-existing tool would make the exploration of a database impossible and would require the preparation of each dataset separately for each visualisation.) -> - **Flexibility**: We can use automation to change our entire system all at once. For example, if we decide we want to use a different source referencing style, we could easily update this across hundreds of charts. This makes it possible to scale our publication and to sustainably improve our work without starting from scratch at each round. -> - **Risk mitigation**: We hope(!) that Our World in Data is a long-term project and we want the visualizations we produce to continue to be useful and available years from now. An external web service may be shut down or change for reasons we cannot control. We have had this experience in the past and learned our lesson from it. -> - **Keeping everything up-to-date**: Because we want to be a useful resource for some time we make sure that we have a technology in place that allows us to keep all of our work up-to-date without starting from scratch each time. We have our global development database directly integrated in the Grapher and as soon as new data becomes available (for example from a UN agency) we can run a script that pulls in that data and updates all the visualizations that present that data. +> - **Integration with our global development database**: Our database of global development metrics is integrated into our visualization tool so that when we add and update empirical data the visualizations are all updated. (In contrast to this, a pre-existing tool would make the exploration of a database impossible and would require the preparation of each dataset separately for each visualisation.) +> - **Flexibility**: We can use automation to change our entire system all at once. For example, if we decide we want to use a different source referencing style, we could easily update this across hundreds of charts. This makes it possible to scale our publication and to sustainably improve our work without starting from scratch at each round. +> - **Risk mitigation**: We hope(!) that Our World in Data is a long-term project and we want the visualizations we produce to continue to be useful and available years from now. An external web service may be shut down or change for reasons we cannot control. We have had this experience in the past and learned our lesson from it. +> - **Keeping everything up-to-date**: Because we want to be a useful resource for some time we make sure that we have a technology in place that allows us to keep all of our work up-to-date without starting from scratch each time. We have our global development database directly integrated in the Grapher and as soon as new data becomes available (for example from a UN agency) we can run a script that pulls in that data and updates all the visualizations that present that data. --- diff --git a/adminSiteClient/Forms.tsx b/adminSiteClient/Forms.tsx index 52b4ad37cd7..5db987cd779 100644 --- a/adminSiteClient/Forms.tsx +++ b/adminSiteClient/Forms.tsx @@ -1014,7 +1014,7 @@ export class BindAutoStringExt< render() { const { readFn, auto, store, ...rest } = this.props const currentReadValue = this.props.isAuto - ? auto ?? readFn(store) + ? (auto ?? readFn(store)) : readFn(store) return ( faq.gdocId)) diff --git a/db/migration/1729763649580-SetYAxisMinDefaultToZero.ts b/db/migration/1729763649580-SetYAxisMinDefaultToZero.ts index 659650f19be..558b6af7c92 100644 --- a/db/migration/1729763649580-SetYAxisMinDefaultToZero.ts +++ b/db/migration/1729763649580-SetYAxisMinDefaultToZero.ts @@ -76,8 +76,8 @@ export class SetYAxisMinDefaultToZero1729763649580 const fullConfig = mergeGrapherConfigs( defaultGrapherConfig as any, - chart.isInheritanceEnabled ? etlConfig ?? {} : {}, - chart.isInheritanceEnabled ? adminConfig ?? {} : {}, + chart.isInheritanceEnabled ? (etlConfig ?? {}) : {}, + chart.isInheritanceEnabled ? (adminConfig ?? {}) : {}, patchConfig ) diff --git a/db/readme.md b/db/readme.md index 7803c83baae..7437f9013ea 100644 --- a/db/readme.md +++ b/db/readme.md @@ -18,8 +18,8 @@ yarn runDbMigrations This **runs automatically in the server deploy script**, so you only need to run it manually when: -- You are creating a new migration locally, or -- Someone else has created a migration +- You are creating a new migration locally, or +- Someone else has created a migration The database dumps we provide has all migrations already applied. diff --git a/devTools/fonts/README.md b/devTools/fonts/README.md index 28894f44182..6fdbc9b1753 100644 --- a/devTools/fonts/README.md +++ b/devTools/fonts/README.md @@ -17,9 +17,9 @@ You can also run `make report` to display the current division of characters bet ## Dependencies -- Python3 (in order to use the [`fontTools.ttLib`](https://pypi.org/project/fonttools/) module for converting otf to woff2, creating the LatoLatin & PlayfairLatin fonts with its [subset](https://fonttools.readthedocs.io/en/latest/subset/index.html) tool, and unpacking the `cmap` table to calculate `unicode-range` settings for switching between the subset and full version in the browser) -- the repo's copies of prettier and express in `../../node_modules` -- the `jq` command line tool +- Python3 (in order to use the [`fontTools.ttLib`](https://pypi.org/project/fonttools/) module for converting otf to woff2, creating the LatoLatin & PlayfairLatin fonts with its [subset](https://fonttools.readthedocs.io/en/latest/subset/index.html) tool, and unpacking the `cmap` table to calculate `unicode-range` settings for switching between the subset and full version in the browser) +- the repo's copies of prettier and express in `../../node_modules` +- the `jq` command line tool ## Typefaces diff --git a/devTools/graphersToGit/readme.md b/devTools/graphersToGit/readme.md index 41a1fd1c210..08162d472fc 100644 --- a/devTools/graphersToGit/readme.md +++ b/devTools/graphersToGit/readme.md @@ -6,6 +6,6 @@ Although that project is not currently in progress, some of the things we need t Specifically the things we need for Next Operation Merge: -- Identify all current usage of legacy Grapher features to help with legacy transform code -- Identify all "exceptional" charts where combinations are being using in an unusual way (i.e. different variable selections for the same entities) -- See all current Graphers without all default property noise +- Identify all current usage of legacy Grapher features to help with legacy transform code +- Identify all "exceptional" charts where combinations are being using in an unusual way (i.e. different variable selections for the same entities) +- See all current Graphers without all default property noise diff --git a/devTools/regionsUpdater/readme.md b/devTools/regionsUpdater/readme.md index a813c86b0ff..b46cb3ed984 100644 --- a/devTools/regionsUpdater/readme.md +++ b/devTools/regionsUpdater/readme.md @@ -4,17 +4,17 @@ This script retrieves the ETL's [country & region data](https://github.com/owid/ The data file is used primarily for: -- associating country names and codes (see `EntityCodes.ts`) -- determining whether a given country is mappable (see `EntitiesOnTheMap.ts`) -- determining whether entities are states and which of those have country pages (see `regions.ts`) -- establishing region → country mappings (see `WorldRegionsToProjection.ts`) +- associating country names and codes (see `EntityCodes.ts`) +- determining whether a given country is mappable (see `EntitiesOnTheMap.ts`) +- determining whether entities are states and which of those have country pages (see `regions.ts`) +- establishing region → country mappings (see `WorldRegionsToProjection.ts`) In addition, the script regenerates [TopoJSON file](../../packages/@ourworldindata/grapher/src/mapCharts/MapTopology.ts) containing country outlines for the world map. It fetches the current, low-res version of the data from [worldmap-sensitive](https://github.com/alexabruck/worldmap-sensitive) and applies the following transformations to it: -- Greenland’s outline is separated out from Denmark’s -- The placeholder code for Kosovo gets replaced with `OWID_KOS` -- French Southern Territories isn’t present in the source map and is added manually -- Palestine’s outline is just the West Bank, so an additional polygon is added for Gaza +- Greenland’s outline is separated out from Denmark’s +- The placeholder code for Kosovo gets replaced with `OWID_KOS` +- French Southern Territories isn’t present in the source map and is added manually +- Palestine’s outline is just the West Bank, so an additional polygon is added for Gaza ## Updating Region Data & Geography diff --git a/devTools/tsconfigs/readme.md b/devTools/tsconfigs/readme.md index 0d4ab00139c..cd6522f8d73 100644 --- a/devTools/tsconfigs/readme.md +++ b/devTools/tsconfigs/readme.md @@ -17,23 +17,23 @@ tsc -b --verbose ## References -- tsconfig options reference https://www.typescriptlang.org/tsconfig +- tsconfig options reference https://www.typescriptlang.org/tsconfig -- tsc build flag https://www.typescriptlang.org/docs/handbook/project-references.html#tsc--b-commandline +- tsc build flag https://www.typescriptlang.org/docs/handbook/project-references.html#tsc--b-commandline -- Tips for Performant TypeScript https://github.com/microsoft/TypeScript/wiki/Performance +- Tips for Performant TypeScript https://github.com/microsoft/TypeScript/wiki/Performance -- Centralized Recommendations for TSConfig bases https://github.com/tsconfig/bases/ +- Centralized Recommendations for TSConfig bases https://github.com/tsconfig/bases/ -- Project References https://www.typescriptlang.org/docs/handbook/project-references.html (especially #overall-structure) +- Project References https://www.typescriptlang.org/docs/handbook/project-references.html (especially #overall-structure) -- Look at tsconfigs in the TypeScript project https://github.com/microsoft/TypeScript/tree/master/src +- Look at tsconfigs in the TypeScript project https://github.com/microsoft/TypeScript/tree/master/src -- config file inheritance https://www.typescriptlang.org/docs/handbook/tsconfig-json.html +- config file inheritance https://www.typescriptlang.org/docs/handbook/tsconfig-json.html -- how shopify does it: https://shopify.engineering/migrating-large-typescript-codebases-project-references +- how shopify does it: https://shopify.engineering/migrating-large-typescript-codebases-project-references -- project references demos: https://github.com/RyanCavanaugh/project-references-demo +- project references demos: https://github.com/RyanCavanaugh/project-references-demo ## FAQ diff --git a/devTools/wayback/readme.md b/devTools/wayback/readme.md index c3e60a0ab82..452428ad5bd 100644 --- a/devTools/wayback/readme.md +++ b/devTools/wayback/readme.md @@ -17,6 +17,6 @@ To go wayback, say to July 1st, 2020, go to the `owid-static` folder and run a c ## Todo: -- Fix some missing images and url bugs -- Fix a "replaceState" bug with the Covid Explorer -- Add an easier ability to jump to different checkpoints by date? +- Fix some missing images and url bugs +- Fix a "replaceState" bug with the Covid Explorer +- Add an easier ability to jump to different checkpoints by date? diff --git a/docs/browser-support.md b/docs/browser-support.md index fdd9b1a3e2d..fb1084c8657 100644 --- a/docs/browser-support.md +++ b/docs/browser-support.md @@ -2,11 +2,11 @@ As of **2024-03-20**, we support the following browsers: -- Safari 12+ [September 2018] (earlier versions are missing support for [the CSS `gap` property](https://caniuse.com/mdn-css_properties_gap_grid_context)) -- iOS Safari 12+ [September 2018] (earlier versions are missing support for [the CSS `gap` property](https://caniuse.com/mdn-css_properties_gap_grid_context)) -- Chrome/Edge 66+ [April 2018] (earlier versions are missing support for [Optional catch binding](https://caniuse.com/mdn-javascript_statements_try_catch_optional_catch_binding)) -- Opera 53+ [May 2018] (since Opera 53 is based on Chromium 66) -- Firefox 78+ [June 2020] (earlier versions are missing support for [Unicode character class escapes in regular expressions](https://caniuse.com/mdn-javascript_regular_expressions_unicode_character_class_escape)) +- Safari 12+ [September 2018] (earlier versions are missing support for [the CSS `gap` property](https://caniuse.com/mdn-css_properties_gap_grid_context)) +- iOS Safari 12+ [September 2018] (earlier versions are missing support for [the CSS `gap` property](https://caniuse.com/mdn-css_properties_gap_grid_context)) +- Chrome/Edge 66+ [April 2018] (earlier versions are missing support for [Optional catch binding](https://caniuse.com/mdn-javascript_statements_try_catch_optional_catch_binding)) +- Opera 53+ [May 2018] (since Opera 53 is based on Chromium 66) +- Firefox 78+ [June 2020] (earlier versions are missing support for [Unicode character class escapes in regular expressions](https://caniuse.com/mdn-javascript_regular_expressions_unicode_character_class_escape)) **Overall, [this caniuse link shows which browsers are supported](https://caniuse.com/mdn-css_properties_gap_grid_context,es6-module,mdn-javascript_statements_try_catch_optional_catch_binding,mdn-javascript_regular_expressions_unicode_character_class_escape)** (scroll down to "Feature summary"). @@ -14,11 +14,11 @@ As of **2024-03-20**, we support the following browsers: "Most breaking" features we use are: -- [Optional catch binding](https://caniuse.com/mdn-javascript_statements_try_catch_optional_catch_binding), which allows for `catch {}` instead of `catch (e) {}`. - We don't _have_ to use it, but Chrome < 66 is so uncommon now that's it not a worry. -- [ES6 modules](https://caniuse.com/es6-module), where we use `