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
TypeScript 4.5 linting #13807
TypeScript 4.5 linting #13807
Conversation
in an attempts to get the no-unused-props replacement working
The no-invalid-this errors where it really shouldn't error
We need to get rid of tslint-microsoft-contrib and this rule isn't even recommended any more microsoft/tslint-microsoft-contrib#676 (comment)
@@ -100,9 +99,7 @@ rules: | |||
'@typescript-eslint/no-explicit-any': off | |||
'@typescript-eslint/no-inferrable-types': off | |||
'@typescript-eslint/no-empty-function': off | |||
|
|||
# Babel | |||
babel/no-invalid-this: 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.
I don't know what was happening here but as soon as I bumped one of the @typescript-eslint
packages this started reporting errors all over the place so I had to disable it. I can't remember a single time this rule has saved us so I'm not concerned about it going away.
@@ -114,6 +111,8 @@ rules: | |||
react/jsx-uses-vars: error | |||
react/jsx-uses-react: error | |||
react/no-unused-state: error | |||
react/no-unused-prop-types: 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 isn't actually working at the moment but we want it as soon as it does. I've opened jsx-eslint/eslint-plugin-react#3195 to discuss possible solutions
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.
And it's been merged already! Yay!
@@ -0,0 +1,68 @@ | |||
import * as React from 'react' |
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 file and others like is are here because of the no-use-before-declare
rule being unhappy with our previous state of affairs.
With this we're loosing the |
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.
🎉
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.
✨
Description
This change was intended to be part of the TS 4.5 PR (#13768) but the changes grew large enough that I felt it warranted a separate PR in order to make it easier to review.
The
tslint-microsoft-contrib
package didn't have a compatible peer dependency with TS 4.5 and while it still worked (kinda) the package has been deprecated and archived since long ago. So I set out to try and find replacements for as many of the rules that I could and remove any obsolete rules.I'll make some comments in the diff below to make it easier to review.
Release notes
Notes: