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

refactor: Added consistent-type-imports eslint rule and ran --fix #2230

Merged
merged 4 commits into from
Sep 20, 2024

Conversation

bmingles
Copy link
Contributor

@bmingles bmingles commented Sep 19, 2024

  • Added @typescript-eslint/consistent-type-imports linting rule
  • Added package script lint:packages
  • Ran npm run lint:packages -- --fix

Note: despite the crazy large number of files, most of these were changed automatically by eslint --fix, so should be able to skim provided all automated tests pass.

resolves #2229

BREAKING CHANGE: eslint rule will require type only imports where possible

@bmingles bmingles requested review from a team and dgodinez-dh and removed request for a team September 19, 2024 23:00
@mattrunyon
Copy link
Collaborator

Can you update the rule to prefer inline-type-imports? It should remove a bunch of the duplicated imports just for types. TS 4.5+ added so you can do import { a, type b } from 'c';. Might reduce the number of files too since we do this in a bunch of places

@bmingles
Copy link
Contributor Author

Can you update the rule to prefer inline-type-imports? It should remove a bunch of the duplicated imports just for types. TS 4.5+ added so you can do import { a, type b } from 'c';. Might reduce the number of files too since we do this in a bunch of places

Done. Good call

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.61%. Comparing base (96e3d43) to head (ba75eb2).

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2230    +/-   ##
========================================
  Coverage   46.61%   46.61%            
========================================
  Files         692      692            
  Lines       38508    38508            
  Branches     9619     9826   +207     
========================================
  Hits        17949    17949            
+ Misses      20548    20506    -42     
- Partials       11       53    +42     
Flag Coverage Δ
unit 46.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmingles bmingles merged commit 2744f97 into deephaven:main Sep 20, 2024
12 checks passed
@bmingles bmingles deleted the 2229-consistent-type-imports branch September 20, 2024 13:43
@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eslint rule: @typescript-eslint/consistent-type-imports
3 participants