Skip to content

feat: add missing converters for rxjs rules #1195

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

Merged
merged 2 commits into from
Aug 29, 2021

Conversation

rafaelss95
Copy link
Contributor

@rafaelss95 rafaelss95 commented Aug 29, 2021

PR Checklist

Overview

There's no specific issue for this, but as I saw that there're some missing rule converters from rxjs-tslint-rules I decided to propose its addition.

Ref: cartant/eslint-plugin-rxjs#7

["rxjs-no-subject-unsubscribe", convertNoSubjectUnubscribe],
["rxjs-no-subject-value", convertNoSubjectValue],
["rxjs-no-tap", convertNoTap],
Copy link
Contributor Author

@rafaelss95 rafaelss95 Aug 29, 2021

Choose a reason for hiding this comment

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

The most correct way to convert this and no-do rules would be to convert it to ban-operators (as no-tap is deprecated) however, the ban-operators might already be declared in tslint.json and then it would give an error, I believe. Thoughts on this, @JoshuaKGoldberg?

Never mind, I guess (well, I hope so 😆) that I've figured out it by creating a merger.

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Fantastic, thanks @rafaelss95! 🚀

@@ -518,12 +540,23 @@ export const ruleConverters = new Map([
["react-tsx-curly-spacing", convertReactTsxCurlySpacing],
["relative-url-prefix", convertRelativeUrlPrefix],
["restrict-plus-operands", convertRestrictPlusOperands],
["rxjs-ban-observables", convertBanObservables],
["rxjs-ban-operators", convertBanOperators],
["rxjs-finnish", convertFinnish],
Copy link
Member

Choose a reason for hiding this comment

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

This got me confused for a bit: there's both finnish and no-finnish as separate rules. Got it!

...newOptions?.[0],
},
];
};
Copy link
Member

Choose a reason for hiding this comment

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

Yeah 👍 this is the way to go!

@JoshuaKGoldberg JoshuaKGoldberg merged commit 2d0cf99 into typescript-eslint:main Aug 29, 2021
@rafaelss95 rafaelss95 deleted the feat/rxjs branch August 30, 2021 02:22
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.

2 participants