-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
upgrade parser & plugin to 2.19.0 #224
Conversation
src/index.test.ts
Outdated
@@ -46,8 +48,10 @@ test('export', (t): void => { | |||
'space-before-function-paren': 'off', | |||
'@typescript-eslint/adjacent-overload-signatures': 'error', | |||
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }], | |||
'@typescript-eslint/ban-ts-comment': 'error', |
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.
Hmm, this will be a breaking change for us 😬
It would also be a bit weird to disable the warning on a per-case basis since it would then always be two "magical" comments:
/* eslint-disable-next-line */
// @ts-ignore
foobar()
In my opinion, if someone has already made the special comment @ts-ignore
, they know what they are doing. I'm not sure that the linter should enforce that we never use it.
I find that there are still quite a few legit cases where it has to be used simply because TypeScript can't express everything that JS does at the moment...
sidenote: I'm also not sure about disallowing !
as we do now. Sometimes it's simply needed because TypeScript haven't understood that we have already checked the condition in some way...
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.
@LinusU is there a @ts-ignore
where any
would not be a better alternative?
Regarding no-non-null-assertion, could you please make that an issue, if you find it a burden?
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.
@LinusU removed it from this pull request.
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.
I actually think that @ts-ignore
is a much cleaner way to signal something that isn't possible with TypeScript at the moment than just casting to any
.
- Since
any
already has a legitimate use case it's hard to search your entire codebase for it, and it doesn't stand out as much when you see it. @ts-ignore
lets you very easy add context on why you have to ignore it. Most of the time I will link to a TypeScript issue directly in the comment:
// @ts-ignore https://github.com/microsoft/TypeScript/issues/26113
Thanks for removing it ❤️ I'm open to discussing this further if you want to 👍
@@ -86,6 +90,7 @@ test('export', (t): void => { | |||
} | |||
], | |||
'@typescript-eslint/no-array-constructor': 'error', | |||
'@typescript-eslint/no-dupe-class-members': 'error', |
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.
Nice! 👍
@@ -102,10 +107,12 @@ test('export', (t): void => { | |||
'@typescript-eslint/no-misused-new': 'error', | |||
'@typescript-eslint/no-misused-promises': 'error', | |||
'@typescript-eslint/no-namespace': 'error', | |||
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error', |
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 won't do anything at the moment since @typescript-eslint/no-non-null-assertion
makes it so that you can never come here. But it's still nice to enable it, since we might change @typescript-eslint/no-non-null-assertion
in the future 👍
'@typescript-eslint/no-non-null-assertion': 'error', | ||
'@typescript-eslint/no-this-alias': ['error', { allowDestructuring: true }], | ||
'@typescript-eslint/no-throw-literal': 'error', | ||
'@typescript-eslint/no-unnecessary-type-assertion': 'error', | ||
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', |
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.
Neat 👍
BREAKING CHANGE: new rule @typescript-eslint/no-non-null-asserted-optional-chain typescript-eslint/typescript-eslint#1469 BREAKING CHANGE: [no-extra-non-null-assertion] flag optional chain after a non-null assertion typescript-eslint/typescript-eslint#1460 Closes #218.
BREAKING CHANGE: new rule @typescript-eslint/prefer-as-const typescript-eslint/typescript-eslint#1431 Closes #218.
BREAKING CHANGE: new rule @typescript-eslint/no-unnecessary-boolean-literal-compare typescript-eslint/typescript-eslint#242 BREAKING CHANGE: new rule @typescript-eslint/no-dupe-class-members https://github.com/typescript-eslint/typescript-eslint/blob/v2.19.0/packages/eslint-plugin/docs/rules/no-dupe-class-members.md BREAKING CHANGE: new rule @typescript-eslint/switch-exhaustiveness-check https://github.com/typescript-eslint/typescript-eslint/blob/v2.19.0/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md Closes #223.
BREAKING CHANGE: upgrade plugin peerDep
Thank you for the review, @LinusU . |
No description provided.