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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing TSLint with ESLint in react-native's source? #719

Open
JoshuaKGoldberg opened this issue Oct 18, 2023 · 2 comments
Open

Replacing TSLint with ESLint in react-native's source? #719

JoshuaKGoldberg opened this issue Oct 18, 2023 · 2 comments

Comments

@JoshuaKGoldberg
Copy link

Introduction

馃憢 Hi! I'm one of the maintainers of typescript-eslint and was one of the maintainers of TSLint, which is now deprecated in favor of typescript-eslint. Following up on DefinitelyTyped/DefinitelyTyped#66351 (comment): I see there's a tslint.json file in the react-native repository: https://github.com/facebook/react-native/blob/87dbe44db4f211b3cd5f4ed8fc5ad7ee059ff2ba/packages/react-native/types/tslint.json.

Looks like it's there primary for dtslint: https://github.com/facebook/react-native/blob/87dbe44db4f211b3cd5f4ed8fc5ad7ee059ff2ba/package.json#L35-L36

Would you be open to a PR that migrates from TSLint to ESLint?

Details

TSLint is deprecated and hasn't received updates for the latest versions of TypeScript in several years. We've mostly replaced its rules in dtslint with ESLint equivalents: microsoft/DefinitelyTyped-tools#648. At this point the only rule that isn't explicitly converted over are expect-type (see https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type) and npm-naming (microsoft/DefinitelyTyped-tools#681, and not relevant here?).

Discussion points

I couldn't figure out a good place for this in the core react-native repository. Sorry if this issue template wasn't the right one. 馃檪

@NickGerleman
Copy link

We've mostly replaced its rules in dtslint with ESLint equivalents: microsoft/DefinitelyTyped-tools#648. At this point the only rule that isn't explicitly converted over are expect-type (see https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type) and npm-naming (microsoft/DefinitelyTyped-tools#681, and not relevant here?).

dtslint is our only reason for using TSLint I think. Migrating to similar ESLint rules seems reasonable, and I think we already run typescript-eslint as well.

For someone who hasn't been following dtslint as much, can we migrate to ESLint usage, but still preserve functionality like testing typechecking against multiple TS versions?

@JoshuaKGoldberg
Copy link
Author

can we migrate to ESLint usage, but still preserve functionality like testing typechecking against multiple TS versions?

Yes! We're going to have to add that to DefinitelyTyped's usage of dtslint as it is. So I can make a note to send a PR here when it's ready. Thanks!

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

No branches or pull requests

2 participants