-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Linter: Turn on rule to warn missing import type #95462
base: trunk
Are you sure you want to change the base?
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
@gabrielcaires, this may need a rebase/merge -- it looks like there are some pretty fundamental issues with the Docker build. |
0da936f
to
b129d5a
Compare
@daledupreez rebased, I hope it will work now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gabrielcaires, the functional change here is working as expected, but it has some knock-on effects:
- We're adding thousands of new warnings to the linter due to existing issues in the code
- Some of the new warnings can't be fixed automatically, as the fixed code triggers other linting issues, especially around
import/order
andimport/no-duplicates
, but it looks like there are also some "import()
type annotations are forbidden" warnings
While I really want this to land, I think we need a clearer, documented plan for getting the changes into the code base before we can generate all the noise this new rule will create.
@daledupreez Next week, I will investigate it. The most similar PR I found was this one: https://github.com/Automattic/wp-calypso/pull/91408/files If we have a volunteer to review, I am okay with making some PRs to fix the lint issues gradually in 3-4 PRs. |
I'd be more than happy to review the PRs! It may make sense to run the linter/fixer on the code base first, identify the issues, and then fix them across a handful of PRs, and then finally deploy the overall linter change once the codebase is in a better position. |
Closes # #87244
Proposed Changes
Turn on rule '@typescript-eslint/consistent-type-import`
"TypeScript allows specifying a type keyword on imports to indicate that the export exists only in the type system, not at runtime. This allows transpilers to drop imports without knowing the types of the dependencies."
Why are these changes being made?
*Ensure transpilers will safely be removed from the bundle files that we are only importing the type.
Testing Instructions
ts(x)
file that is importing a type (E.g. /client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-identify/index.tsx)Pre-merge Checklist