-
Notifications
You must be signed in to change notification settings - Fork 84
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
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
changed the title
Improved ESLint configuration
H-2457: Improved ESLint configuration
Mar 24, 2024
# Conflicts: # apps/hash-ai-worker-ts/package.json # apps/hash-integration-worker/package.json # libs/@blockprotocol/graph/package.json # libs/@local/hash-backend-utils/package.json # libs/@local/hash-graph-client/typescript/package.json # libs/@local/hash-graph-sdk/typescript/package.json # libs/@local/hash-graph-types/typescript/package.json # libs/@local/hash-subgraph/.eslintrc.cjs # libs/@local/status/typescript/.eslintrc.cjs # libs/@local/status/typescript/package.json # yarn.lock
github-actions
bot
removed
the
area/deps
Relates to third-party dependencies (area)
label
Jul 19, 2024
github-actions
bot
added
area/deps
Relates to third-party dependencies (area)
area/infra > docker
type/legal
Owned by the @legal team
area/apps > hash.design
Affects the `hash.design` design site (app)
labels
Jul 19, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4232 +/- ##
=======================================
Coverage 18.24% 18.25%
=======================================
Files 482 482
Lines 16041 16038 -3
Branches 2452 2449 -3
=======================================
Hits 2927 2927
+ Misses 13076 13073 -3
Partials 38 38 ☔ View full report in Codecov by Sentry. |
3 tasks
Benchmark results
|
Function | Value | Mean | Flame graphs |
---|---|---|---|
link_by_source_by_property | depths: DT=255, PT=255, ET=255, E=255 | Flame Graph | |
link_by_source_by_property | depths: DT=0, PT=2, ET=2, E=2 | Flame Graph | |
link_by_source_by_property | depths: DT=2, PT=2, ET=2, E=2 | Flame Graph | |
link_by_source_by_property | depths: DT=0, PT=0, ET=0, E=0 | Flame Graph | |
link_by_source_by_property | depths: DT=0, PT=0, ET=2, E=2 | Flame Graph | |
link_by_source_by_property | depths: DT=0, PT=0, ET=0, E=2 | Flame Graph | |
entity_by_property | depths: DT=255, PT=255, ET=255, E=255 | Flame Graph | |
entity_by_property | depths: DT=0, PT=2, ET=2, E=2 | Flame Graph | |
entity_by_property | depths: DT=2, PT=2, ET=2, E=2 | Flame Graph | |
entity_by_property | depths: DT=0, PT=0, ET=0, E=0 | Flame Graph | |
entity_by_property | depths: DT=0, PT=0, ET=2, E=2 | Flame Graph | |
entity_by_property | depths: DT=0, PT=0, ET=0, E=2 | Flame Graph |
scaling_read_entity_linkless
Function | Value | Mean | Flame graphs |
---|---|---|---|
entity_by_id | 100 entities | Flame Graph | |
entity_by_id | 10 entities | Flame Graph | |
entity_by_id | 1 entities | Flame Graph | |
entity_by_id | 1000 entities | Flame Graph | |
entity_by_id | 10000 entities | Flame Graph |
representative_read_entity_type
Function | Value | Mean | Flame graphs |
---|---|---|---|
get_entity_type_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579
|
Flame Graph |
scaling_read_entity_complete_one_depth
Function | Value | Mean | Flame graphs |
---|---|---|---|
entity_by_id | 25 entities | Flame Graph | |
entity_by_id | 5 entities | Flame Graph | |
entity_by_id | 50 entities | Flame Graph | |
entity_by_id | 10 entities | Flame Graph | |
entity_by_id | 1 entities | Flame Graph |
scaling_read_entity_complete_zero_depth
Function | Value | Mean | Flame graphs |
---|---|---|---|
entity_by_id | 25 entities | Flame Graph | |
entity_by_id | 5 entities | Flame Graph | |
entity_by_id | 50 entities | Flame Graph | |
entity_by_id | 10 entities | Flame Graph | |
entity_by_id | 1 entities | Flame Graph |
representative_read_entity
Function | Value | Mean | Flame graphs |
---|---|---|---|
entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1
|
Flame Graph | |
entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2
|
Flame Graph | |
entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1
|
Flame Graph | |
entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1
|
Flame Graph | |
entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1
|
Flame Graph | |
entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1
|
Flame Graph | |
entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1
|
Flame Graph | |
entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1
|
Flame Graph | |
entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1
|
Flame Graph |
closed in favor of #5847 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/apps > hash.design
Affects the `hash.design` design site (app)
area/apps > hash.dev
Affects the `hash.dev` developer site (app)
area/apps > hash*
Affects HASH (a `hash-*` app)
area/apps > hash-api
Affects the HASH API (app)
area/apps > hash-graph
area/apps > hash-realtime
area/apps > hash-search-loader
area/apps
area/blocks
Relates to first-party blocks (area)
area/deps
Relates to third-party dependencies (area)
area/infra > docker
area/infra
Relates to version control, CI, CD or IaC (area)
area/libs
Relates to first-party libraries/crates/packages (area)
area/tests > integration
New or updated integration tests
area/tests > playwright
New or updated Playwright tests
area/tests
New or updated tests
priority/2 medium
Medium priority: needs to be done
type/eng > backend
Owned by the @backend team
type/eng > frontend
Owned by the @frontend team
type/legal
Owned by the @legal team
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🌟 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:
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 this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
turbo.json
's have been updated to reflect this