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: switch to biome for lint and format #2430

Merged
merged 2 commits into from
Jan 14, 2025
Merged

chore: switch to biome for lint and format #2430

merged 2 commits into from
Jan 14, 2025

Conversation

pwltr
Copy link
Collaborator

@pwltr pwltr commented Jan 10, 2025

Description

Switch to BiomeJS from ESLint & Prettier. Biome is simpler to configure, way faster and also smarter. It can catch bugs and find performance issues.

Tried to keep changes to lint rules in this PR to a minimum but included are:

  • unnecessary else clause
  • don't override global Error
  • no useless React.Fragments
  • unnecessary dependencies in useEffect, useMemo, useCallback
  • missing or additional dependencies in the above require a ignore comment with explanation (todo)
  • types for uninitialised variables
  • avoid returning expressions (like getRef={(c): void => (qrRef.current = c)})
  • unnecessary optional chaining
  • use const where possible
  • use template literals instead of string concatenation
  • wrap switch-cases in {} to avoid scope bugs
  • prefer const ... of to forEach

Checks are run pre-commit as before, can use scripts lint:fix & format:fix to auto-fix issues where possible. Some of the rules in biome.json currently turned off would be useful to have but fixes need to be reviewed more closely.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (improving code without creating new functionality)

Tests

  • Detox test
  • Unit test
  • No test

Copy link

socket-security bot commented Jan 10, 2025

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

@pwltr pwltr force-pushed the chore/biome branch 2 times, most recently from b956bda to d0b71f2 Compare January 10, 2025 15:44
@pwltr pwltr marked this pull request as ready for review January 10, 2025 15:51
@pwltr pwltr requested a review from coreyphillips January 13, 2025 14:59
@pwltr pwltr merged commit 579fc3d into master Jan 14, 2025
7 checks passed
@pwltr pwltr deleted the chore/biome branch January 14, 2025 18:57
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