Skip to content

Conversation

@SmashingQuasar
Copy link
Contributor

Description

This PR fixes #1991.

It does two separate things:

  • Adds the @typescript-eslint/consistent-type-imports rule to force all imports used exclusively as types to be declared with the import type syntax. This will eliminate them at run time.
  • Automatically converts all type imports as such by the eslint --fix feature.

This will solve the underlying problem as it will make @types/readable-stream and @types/ws true development dependencies instead of extraneous dependencies.

@codecov
Copy link

codecov bot commented May 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.46%. Comparing base (3c1f335) to head (26327ee).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1993   +/-   ##
=======================================
  Coverage   81.46%   81.46%           
=======================================
  Files          25       25           
  Lines        1565     1565           
  Branches      366      366           
=======================================
  Hits         1275     1275           
  Misses        199      199           
  Partials       91       91           
Flag Coverage Δ
unittests 81.46% <100.00%> (ø)

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.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@robertsLando robertsLando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@robertsLando robertsLando changed the title chore(1991): Added @typescript-eslint/consistent-type-imports rule and normalised all imports. fix: add @typescript-eslint/consistent-type-imports rule and normalised all imports. May 6, 2025
@robertsLando robertsLando changed the title fix: add @typescript-eslint/consistent-type-imports rule and normalised all imports. fix: add @typescript-eslint/consistent-type-imports rule and normalised all imports May 6, 2025
@robertsLando robertsLando enabled auto-merge (squash) May 6, 2025 15:57
@robertsLando robertsLando disabled auto-merge May 6, 2025 15:57
@robertsLando robertsLando merged commit 640cd3b into mqttjs:main May 6, 2025
9 checks passed
@SmashingQuasar SmashingQuasar deleted the fork/SmashingQuasar/1991-normalise-import-types branch May 6, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Build error: Could not find a declaration file for module 'ws' in 5.11.1 and beyond - works in 5.11.0

2 participants