penumbra-zone / web

Apache License 2.0
10 stars 7 forks source link

don't write our own eslint config #1269

Open turbocrime opened 2 weeks ago

turbocrime commented 2 weeks ago

turns out eslint config is complex in monorepos, especially since some of the plugins we use have declined to implement the necessary changes for v9 compatibility

there are also various issues with our current config, and it is incomplete regarding code style, leading to review comments about style.

i suggest that we simply use an existing config maintained by a third party, wherein plugin integration is solved, and select rules that prevent future discussion of style

a few months ago when i learned about flat-config, i experimented with antfu's config. it is simple to set up and stricter than our current config in many regards: https://github.com/antfu/eslint-config

it also integrates most of our existing plugins or equivalents, including the problematic react and react-hooks

however, it makes some quirky choices such as rule renaming, and it would need a bit of config to avoid a very large diff - or, possibly, we just accept the diff in favor of minimal effort.

this should probably be low priority at the moment, i am creating this issue to collect discussion

turbocrime commented 2 weeks ago

oxlint is a reimplementation of some eslint in rust. it intends to parse existing eslint config and check a subset of the rules, faster than eslint does. it also provides a plugin for eslint to prevent double-checking the same rules, and thus achieve an overall accelerated lint run.

it feels a little hacky, but we've already had oom issues in CI from the linter, so oxlint may be worth investigating if it's easy to add.