Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add/configure code style toolchain #17

Merged
merged 29 commits into from
Feb 23, 2024
Merged

Conversation

helmturner
Copy link
Member

@helmturner helmturner commented Feb 17, 2024

This PR adds prettier, along with a an opinionated configuration. The exact config isn't necessarily set in stone, but you can see the difference in here

If everyone is okay with this config I can revert the commit that applies the formatting and commit the config and the formatting results as separate PRs

Edit: This PR also adds and configures TypeScript and TypeScript-ESLint

@helmturner helmturner requested review from zenlex, CKCarr and deino475 and removed request for zenlex February 17, 2024 23:13
@helmturner helmturner self-assigned this Feb 17, 2024
@CKCarr CKCarr marked this pull request as ready for review February 18, 2024 05:24
CKCarr
CKCarr previously approved these changes Feb 18, 2024
Copy link
Collaborator

@CKCarr CKCarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed the changes introduced by the Prettier configuration, the improvements in readability and cleanliness carry across the codebase. The formatting applied to files made a notable difference. I think it would be good apply this configuration.

This reverts commit 06525d5.
TS doesn't choke on comments in tsconfig.json
- removed referencces to expensify
- removed/fixed parts that were irrelevent to this project
- added 'single source of truth' file for globals/module augmentation
zenlex
zenlex previously approved these changes Feb 21, 2024
Copy link
Contributor

@zenlex zenlex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this, I'd just prefer single quotes and tabs over double quotes and spaces if that's agreeable. You make the call and merge it, I'll live either way. Thanks for the work!

@helmturner helmturner marked this pull request as draft February 21, 2024 23:30
@helmturner helmturner changed the title chore: add/configure formatter chore: add/configure code style toolchain Feb 21, 2024
@helmturner
Copy link
Member Author

There's a bit of overlap with the style enforcement tools, so I'm just lumping them in one PR

@helmturner helmturner force-pushed the chore/with-formatting branch from a463b3f to a3463cc Compare February 22, 2024 00:20
@helmturner helmturner force-pushed the chore/with-formatting branch from 578e65b to d5cfccc Compare February 22, 2024 19:36
@helmturner
Copy link
Member Author

helmturner commented Feb 22, 2024

Well, it doesn't get us linting in astro files... but we get TS and Prettier, so I'm cool with it. The linting rules will almost definitely need some fine tuning, but they're pretty comprehensive to start. As we get feedback we can fine tune them where appropriate.

@helmturner helmturner marked this pull request as ready for review February 22, 2024 20:15
@helmturner helmturner requested review from zenlex and CKCarr February 22, 2024 20:20
@helmturner helmturner force-pushed the chore/with-formatting branch from dc081b4 to 518a099 Compare February 22, 2024 22:02
Copy link
Contributor

@zenlex zenlex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! thanks for all your work and TS ecosystem knowledge.

@zenlex zenlex merged commit 68cfd4c into dev Feb 23, 2024
2 checks passed
@zenlex zenlex deleted the chore/with-formatting branch February 23, 2024 01:20
zenlex pushed a commit that referenced this pull request Apr 27, 2024
* chore: add/configure formatter

* style: format

* chore: revert to whole-file format on save

* Revert "style: format"

This reverts commit 06525d5.

* chore: pin dependencies

* chore: add TS style guide

Pulled from https://github.com/Expensify/App

* chore: add explicit typescript dependency

* chore: allow comments in tsconfig

TS doesn't choke on comments in tsconfig.json

* style: make tsconfig slightly more strict

* chore: customize TYPESCRIPT.md

- removed referencces to expensify
- removed/fixed parts that were irrelevent to this project
- added 'single source of truth' file for globals/module augmentation

* style: udpate prettier to use tabs, single quotes

Also removes redundant options that were previously explicit
see: https://techlahoma.slack.com/archives/C061ADYPHNJ/p1708476318174819

* chore: cleanup prettier config

* style: enable type acquisition

* chore: remove temp comments

* chore: fix typos in tsconfig/settings.json

* chore: add linter dependencies

* chore: configure eslint for unicorn/airbnb

* chore: force using npm as package manager

* chore: revert to spaces over tabs

tabs reached consensus based on the misconception that 1 tab is 2 spaces

* chore: add eslint extension to recommendations

* chore: fix type errors, refine tsconfig

* chore: add eslint script

* chore: exclude node_modules from type checking

* chore: add unicorn, fix lint config + eslint types

* chore: refine eslint config, fix errors

* chore: pin deps

* chore: update workspace recommendations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants