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

Add code formatter and auto-format existing code #2514

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jake-low
Copy link
Contributor

@jake-low jake-low commented Dec 31, 2024

The diff on this PR is huge, but you can ignore everything under src/ (it's all auto-formatting).

What this PR does:

  • adds Biome as a dependency. Biome is a new code formatter and linter for JavaScript (and also TypeScript, CSS, SCSS). Its formatting output is identical to Prettier, but it's >30x faster. It is also a very capable linter (and much faster than ESLint). I plan to replace our usage of ESLint with Biome's linter in a future PR.
  • formats all existing code with Biome
  • sorts all imports with Biome (this is a separate step in Biome; I ran it as a one-off operation for now but will probably add it to CI too in the future)
  • adds a .git-blame-ignore-revs file to record "uninteresting" commits that should be excluded from git blame output, both locally and on Github. Github uses this file automatically; see the comment in the file for how to configure git to do the same locally.
  • adds a new yarn run format command which runs Biome on all source code and formats it
  • adds a new yarn run check command which checks that code is correctly formatted (using Biome) and that there are no lint errors (using ESLint), but does not modify any code
  • adds an optional git hook to run these checks each time you git commit. There are instructions in DEVELOPMENT.md for setting this up for your development environment.
  • runs the checks in CI to make sure PRs don't introduce new linting or formatting issues

@jake-low jake-low marked this pull request as ready for review January 8, 2025 20:38
CollinBeczak
CollinBeczak previously approved these changes Jan 8, 2025
src/services/Templating/Handlers/OSMViewportHandler.jsx Outdated Show resolved Hide resolved
Co-authored-by: Collin Beczak <88843144+CollinBeczak@users.noreply.github.com>
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.

2 participants