Skip to content

Commit

Permalink
chore: format code with prettier 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber committed Nov 26, 2024
1 parent af703e4 commit aa73d89
Show file tree
Hide file tree
Showing 34 changed files with 339 additions and 337 deletions.
14 changes: 7 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/cycle_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)

Expand Down Expand Up @@ -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.
---

Expand Down
4 changes: 2 additions & 2 deletions adminSiteClient/Forms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<AutoTextField
Expand Down Expand Up @@ -1189,7 +1189,7 @@ export class BindAutoFloatExt<
render() {
const { readFn, auto, store, ...rest } = this.props
const currentReadValue = this.props.isAuto
? auto ?? readFn(store)
? (auto ?? readFn(store))
: readFn(store)
return (
<AutoFloatField
Expand Down
4 changes: 2 additions & 2 deletions baker/DeployUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ const getChangesSlackMentions = async (
`${item.message} (by ${
!item.authorEmail
? item.authorName
: emailSlackMentionMap.get(item.authorEmail) ??
item.authorName
: (emailSlackMentionMap.get(item.authorEmail) ??
item.authorName)
})`
)
}
Expand Down
2 changes: 1 addition & 1 deletion baker/GrapherBaker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export async function renderDataPageV2(
// to use indicator level defaults, we should reconsider how this works here.
const grapher = useIndicatorGrapherConfigs
? mergeGrapherConfigs(grapherConfigForVariable ?? {}, pageGrapher ?? {})
: pageGrapher ?? {}
: (pageGrapher ?? {})

const faqDocIds = compact(
uniq(variableMetadata.presentation?.faqs?.map((faq) => faq.gdocId))
Expand Down
4 changes: 2 additions & 2 deletions db/migration/1729763649580-SetYAxisMinDefaultToZero.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
4 changes: 2 additions & 2 deletions db/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions devTools/fonts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions devTools/graphersToGit/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 8 additions & 8 deletions devTools/regionsUpdater/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 9 additions & 9 deletions devTools/tsconfigs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions devTools/wayback/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Loading

0 comments on commit aa73d89

Please sign in to comment.