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

H-2457: Improved ESLint configuration #4232

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

H-2457: Improved ESLint configuration #4232

wants to merge 18 commits into from

Conversation

indietyp
Copy link
Member

🌟 What is the purpose of this PR?

This PR adds a new ESLint configuration, which is more encompassing and stricter than the previous one.

Instead of trying to roll our own completely, needing to figure out which plugins to use and where I opted for an alternative method.

Instead of creating one from scratch, one uses an existing configuration and applies the necessary changes.

The big contenders currently around after some research are:

  • xo (I have previous experience with this one)
  • sheriff
  • hardcore

While hardcore looked promising, it does not yet expose the flat config configuration.
The main problem with xo is that it is exposed through an alternative binary, making it unsuitable to use in, e.g., WebStorm. It also, by default, lints stylistic choices covered by prettier.

sheriff instead fully embraces ESLint flat configs, is highly configurable, and has an excellent webpage detailing all the configurations used.

This PR will be split into multiple, as some changes won't be immediately visible. This PR only changes the configuration, introducing a package @repo/eslint (name TBD). A follow-up PR then applies the changes to all packages.

Because styling is always very subjective, we can preview the changes without polluting this PR. Some stylistic changes may be contentious and need further discussion (for example: react/jsx-curly-brace-presence). I have already adjusted several rules, to improve it to our needs, enabling some additional ones or removing them.

I would also suggest that once in a semi-stable state one targets this PR with their new changes, so that we can test developer experience.

(I have linted my package in here, and found it quite an improvement)

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • affected the execution graph, and the turbo.json's have been updated to reflect this

@github-actions github-actions bot added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team area/apps labels Mar 24, 2024
@TimDiekmann TimDiekmann changed the title Improved ESLint configuration H-2457: Improved ESLint configuration Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apps > hash* Affects HASH (a `hash-*` app) area/apps area/deps Relates to third-party dependencies (area) area/libs Relates to first-party libraries/crates/packages (area) priority/2 medium Medium priority: needs to be done type/eng > frontend Owned by the @frontend team
Development

Successfully merging this pull request may close these issues.

None yet

2 participants