sugar-cat7 / vspo-portal

WIP すぽじゅーる
https://vspo-schedule-sugar-cat7-s-team.vercel.app
MIT License
12 stars 4 forks source link

📎Review the Settings of Linter/Formatter(Frontend) #26

Closed sugar-cat7 closed 8 months ago

sugar-cat7 commented 1 year ago

Recently, the usability of 'biome' has been good.

https://biomejs.dev/

sruenwg commented 9 months ago

Some quick thoughts I wanted to share after trying out Biome locally:

  1. It might be difficult to fully replace ESLint with Biome since we probably still want to use Next.js's ESLint rules. This would mean our linting step would be carried out by two linters: next lint (ESLint) and biome lint [directory]. (Note that even if we didn't use Next.js's lint rules, we would probably still want to run next lint since the command also performs other Next.js-specific checks.)
  2. The available rules may be insufficient. For example, I was hoping to use no-unnecessary-condition but found no equivalent available in Biome.

If 1. is a problem, my opinion would be to use Biome solely for formatting (not Prettier since, if we believe Biome's benchmarking, Biome is faster) and stick to ESLint for linting.

If 1. is not a significant problem, we could:

I see drawbacks to both approaches and hence would like to hear your thoughts. Are 1. and 2. problems in your opinion? Do either of the two approaches above seem reasonable? @sugar-cat7

sugar-cat7 commented 9 months ago

Thank you for summarizing:)

I think both 1 and 2 would be problematic.

Personally, as you suggest, I believe using Biome solely for formatting and sticking to ESLint for linting would be best.

I assume that Biome will eventually add new Next's ESLint-compatible rules as well, so it might be good to switch to using Biome for linting as well once its linter is sufficiently mature and we can use our own linters without relying on next lint.

sruenwg commented 9 months ago

Sounds good! I agree that an eventual full migration to Biome would make sense once either Next.js becomes Biome-compatible or Biome offers a clean pattern for use with Next.js.