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

Use Biome for linting and formatting #111

Merged
merged 4 commits into from
Mar 12, 2024
Merged

Use Biome for linting and formatting #111

merged 4 commits into from
Mar 12, 2024

Conversation

Jokauppi
Copy link
Member

@Jokauppi Jokauppi commented Mar 11, 2024

Here's a branch to preview and play around with Biome. Feel free to try stuff out and commit.

Seems pretty good to me with a longer line length.

  • Configured Biome
  • Husky and lint-staged were installed but there was no Husky config. Changed these to lefthook. Wrote a few different hooks to choose if wanted.
  • Removed ESlint and Prettier
  • Had to disable some Biome recommended rules to get linting to succeed without --apply-unsafe
    • I think some of these are inconvenient like useTemplate, noUselessElse and noForEach
    • Seems like we are using quite a few double equals, these should be reviewed/removed. Odd that the eslint/recommended didn't complain about these.
    • Biome disallows CJS by default so disabled related rules. Can be enabled after:

@Jokauppi Jokauppi added the Do Not Merge Something prevents merging PR label Mar 11, 2024
@ArktinenKarpalo
Copy link
Contributor

ArktinenKarpalo commented Mar 12, 2024

Are there conflicts with eslint or why was it removed? At least some time ago there were some lint rules that were in eslint but not in biom. It could be useful to use both linters if eslint has some additional rules and there are no bad conflicts/other issues. However I don't know if the situation has improved since, maybe using biomes linter is enough.

@Jokauppi Jokauppi removed the Do Not Merge Something prevents merging PR label Mar 12, 2024
@Jokauppi Jokauppi self-assigned this Mar 12, 2024
@Jokauppi Jokauppi marked this pull request as ready for review March 12, 2024 17:38
@Jokauppi
Copy link
Member Author

There are all eslint:recommended rules not available in biome. Most if not all of these are not needed because they are not applicable in ES6/ESM, Biome disables a related pattern (e.g. var) or because the pattern is handled by Biome formatting.

eslint:recommended rules not available in biome
no-constant-binary-expression
no-delete-var
no-dupe-else-if
no-empty-static-block
no-invalid-regexp
no-irregular-whitespace
no-octal
no-sparse-arrays
no-unexpected-multiline
no-useless-backreference
no-useless-escape

@Jokauppi Jokauppi changed the title Biome linting and formatting test Use Biome for linting and formatting Mar 12, 2024
@Jokauppi Jokauppi merged commit 161b674 into develop Mar 12, 2024
1 check passed
@Jokauppi Jokauppi deleted the biome-test branch March 12, 2024 19:37
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