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

TypeScript 4.5 linting #13807

Merged
merged 13 commits into from Feb 3, 2022
Merged

TypeScript 4.5 linting #13807

merged 13 commits into from Feb 3, 2022

Conversation

niik
Copy link
Member

@niik niik commented Feb 1, 2022

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:

@@ -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
Copy link
Member Author

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
Copy link
Member Author

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

Copy link
Member

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'
Copy link
Member Author

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.

@niik
Copy link
Member Author

niik commented Feb 1, 2022

With this we're loosing the promise-must-complete (https://github.com/desktop/desktop/blob/development/tslint.json#L5) rule which was kinda nice but I haven't found an alternative and I don't think that should prevent us from upgrading and getting rid of tslint.

Copy link
Member

@sergiou87 sergiou87 left a comment

Choose a reason for hiding this comment

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

🎉

Copy link
Contributor

@tidy-dev tidy-dev left a comment

Choose a reason for hiding this comment

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

@niik niik merged commit de51c3f into ts-4.5-minimal Feb 3, 2022
@niik niik deleted the ts-4.5-linting branch February 3, 2022 09:28
@niik niik mentioned this pull request Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants