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

Remove no-unnecessary-qualifier from eslintrc #51456

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

jakebailey
Copy link
Member

For discussion; this saves a lot of lint time.

I don't think we need no-unnecessary-qualifier at all post-modules. no-unnecessary-type-assertion is kinda useful, but does create LKG friction in main.

@typescript-bot
Copy link
Collaborator

Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @amcasey, @mjbvz, @minestarks for you. Feel free to loop in other consumers/maintainers if necessary

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 8, 2022
@jakebailey
Copy link
Member Author

jakebailey commented Nov 8, 2022

In CI:

  • Before JSDoc plugin removal: 1m 7.7s
  • After JSDoc plugin removal: 54.3s
  • This PR: 36s

Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

no-unnecessary-qualifier was 100% a namespace thing that we don't really need anymore - technically you could have both a ns and non-ns import giving you access to something, but I think it's less of an issue now, since using the ns imports at all is comparatively rare.

no-unnecessary-type-assertion feels exactly like the kind of rule we could have a non-error quickfix/suggestion for in the compiler itself to avoid the perf cost, since the comparison we pretty much already do when checking the cast.

@jakebailey
Copy link
Member Author

jakebailey commented Nov 9, 2022

For reference, this is TIMING=1 before:

Rule                                             | Time (ms) | Relative
:------------------------------------------------|----------:|--------:
@typescript-eslint/no-unnecessary-qualifier      |  3650.977 |    29.4%
@typescript-eslint/no-unnecessary-type-assertion |  2400.961 |    19.3%
@typescript-eslint/naming-convention             |  2223.098 |    17.9%
import/no-extraneous-dependencies                |  1482.750 |    11.9%
local/jsdoc-format                               |   206.544 |     1.7%
max-statements-per-line                          |   202.051 |     1.6%
object-shorthand                                 |   175.833 |     1.4%
space-in-parens                                  |   148.240 |     1.2%
@typescript-eslint/brace-style                   |   125.281 |     1.0%
local/no-double-space                            |   123.715 |     1.0%

And after:

Rule                                       | Time (ms) | Relative
:------------------------------------------|----------:|--------:
@typescript-eslint/naming-convention       |  2321.506 |    37.5%
import/no-extraneous-dependencies          |  1300.257 |    21.0%
local/jsdoc-format                         |   201.043 |     3.2%
object-shorthand                           |   180.764 |     2.9%
max-statements-per-line                    |   178.121 |     2.9%
space-in-parens                            |   158.352 |     2.6%
no-trailing-spaces                         |   122.272 |     2.0%
local/no-double-space                      |   114.908 |     1.9%
@typescript-eslint/type-annotation-spacing |   112.901 |     1.8%
@typescript-eslint/brace-style             |   112.493 |     1.8%

@jakebailey
Copy link
Member Author

Also anecdotally, no-unnecessary-type-assertion tends to break on branch switches for me; I end up with errors that don't make sense. Perhaps that's more of a TS bug (since I have similar problems on branch switching sometimes too).

@jakebailey
Copy link
Member Author

Per the design meeting, I'll remove the no-unnecessary-qualifier rule, but we seemed generally not favorable to removing the other one just yet.

@jakebailey jakebailey changed the title Remove TSESLint rules which require type checking Remove no-unnecessary-qualifier from eslintrc Nov 9, 2022
@jakebailey jakebailey marked this pull request as ready for review November 9, 2022 22:45
@jakebailey jakebailey merged commit d798493 into microsoft:main Nov 9, 2022
@jakebailey jakebailey deleted the remove-lint-type-checking branch November 9, 2022 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants