-
Notifications
You must be signed in to change notification settings - Fork 14
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
Evaluate lint rules consistent-type-imports and consistent-type-exports #1283
Comments
I ran a series of type checks under different kinds of changes. This data section is tab-delimited and can be pasted to sublime => excel. Each change type is run 3x for averaging.
After running the 1st column, I autofixed both lint rules. Running that autofix took 7 minutes and modified 1378 files like so: Index: js/lab/model/LabModel.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/lab/model/LabModel.ts b/js/lab/model/LabModel.ts
--- a/js/lab/model/LabModel.ts (revision f622373f19ab3d3065a2f0dc11ad770bd18cf939)
+++ b/js/lab/model/LabModel.ts (date 1657966242078)
@@ -8,10 +8,11 @@
*/
import optionize from '../../../../phet-core/js/optionize.js';
-import EmptyObjectType from '../../../../phet-core/js/types/EmptyObjectType.js';
+import type EmptyObjectType from '../../../../phet-core/js/types/EmptyObjectType.js';
import Tandem from '../../../../tandem/js/Tandem.js';
import centerAndVariability from '../../centerAndVariability.js';
-import CAVModel, { CAVModelOptions } from '../../common/model/CAVModel.js';
+import type { CAVModelOptions } from '../../common/model/CAVModel.js';
+import CAVModel from '../../common/model/CAVModel.js';
import CAVObjectType from '../../common/model/CAVObjectType.js';
import CAVConstants from '../../common/CAVConstants.js';
In these tests, master was better for all but 2 of the samples: So we do not see a performance boost from this experiment. Therefore, I recommend we disable the rules and do not investigate whether WebStorm streamlines type imports and exports during development. @zepumph can you please review this issue and see if there are other angles to consider? |
All looks correct and excellent. I also wanted to say that I have not noticed any readability concerns with in-lining type imports or exports. I also like the documentation in eslintrc. Ready to close! |
From #1277 the comments for the lint rules consistent-type-imports and consistent-type-exports say:
Regarding performance the imports rule says:
and the exports rule says:
So the two parts to investigate for this issue are:
import type
andexport type
?If there is a significant performance boost, but webstorm cannot import/export that style, we may try to get the best of both worlds by leveraging the rule's autofix (either intermittently, like once a month/quarter/week, on save, on commit, etc).
The text was updated successfully, but these errors were encountered: