-
Notifications
You must be signed in to change notification settings - Fork 341
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
lint: update @typescript-eslint, fix warnings #5054
Conversation
@@ -37,7 +36,7 @@ export default ESLintUtils.RuleCreator.withoutDocs({ | |||
meta: { | |||
docs: { | |||
description: 'disallow awaiting on vscode notifications if the response is unused', | |||
recommended: 'error', | |||
recommended: 'recommended', |
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.
'error' is not a valid value here, apparently
Problem: After updating to @typescript-eslint/parser 7.x, importing '@typescript-eslint/types/dist/generated/ast-spec' fails: lib/rules/no-await-on-vscode-msg.ts(15,34): error TS2307: Cannot find module '@typescript-eslint/types/dist/generated/ast-spec' or its corresponding type declarations. lib/rules/no-await-on-vscode-msg.ts(40,13): error TS2322: Type '"error"' is not assignable to type 'RuleRecommendation | RuleRecommendationAcrossConfigs<never[]> | undefined'. lib/rules/no-only-in-tests.ts(13,62): error TS2307: Cannot find module '@typescript-eslint/types/dist/generated/ast-spec' or its corresponding type declarations. lib/rules/no-only-in-tests.ts(32,13): error TS2322: Type '"error"' is not assignable to type 'RuleRecommendation | RuleRecommendationAcrossConfigs<never[]> | undefined'. lib/rules/no-only-in-tests.ts(60,25): error TS2322: Type '`${any}OnlyErrMsg`' is not assignable to type '"describeOnlyErrMsg" | "itOnlyErrMsg"'. Solution: Import from '@typescript-eslint/utils' instead.
switch (message.eventType) { | ||
case 'GENERATE_CLICKED': | ||
case TelemetryType.GENERATE_CLICKED: |
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.
This is another small disadvantage of enums. If a type
was used, the literal value could be used instead.
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.
Would it be better now to switch it from enum
in to a type
instead? It looks safe to do
cccad7c
to
c89208e
Compare
closes #5034
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.