-
Notifications
You must be signed in to change notification settings - Fork 101
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,12 +74,22 @@ import { convertJsxNoLambda } from "./ruleConverters/eslint-plugin-react/jsx-no- | |
import { convertJsxSelfClose } from "./ruleConverters/eslint-plugin-react/jsx-self-close"; | ||
import { convertJsxSpaceBeforeTrailingSlash } from "./ruleConverters/eslint-plugin-react/jsx-space-before-trailing-slash"; | ||
import { convertJsxWrapMultiline } from "./ruleConverters/eslint-plugin-react/jsx-wrap-multiline"; | ||
import { convertBanObservables } from "./ruleConverters/eslint-plugin-rxjs/ban-observables"; | ||
import { convertBanOperators } from "./ruleConverters/eslint-plugin-rxjs/ban-operators"; | ||
import { convertFinnish } from "./ruleConverters/eslint-plugin-rxjs/finnish"; | ||
import { convertJust } from "./ruleConverters/eslint-plugin-rxjs/just"; | ||
import { convertNoAsyncSubscribe } from "./ruleConverters/eslint-plugin-rxjs/no-async-subscribe"; | ||
import { convertNoCompat } from "./ruleConverters/eslint-plugin-rxjs/no-compat"; | ||
import { convertNoConnectable } from "./ruleConverters/eslint-plugin-rxjs/no-connectable"; | ||
import { convertNoCreate } from "./ruleConverters/eslint-plugin-rxjs/no-create"; | ||
import { convertNoExplicitGenerics } from "./ruleConverters/eslint-plugin-rxjs/no-explicit-generics"; | ||
import { convertNoExposedSubjects } from "./ruleConverters/eslint-plugin-rxjs/no-exposed-subjects"; | ||
import { convertNoFinnish } from "./ruleConverters/eslint-plugin-rxjs/no-finnish"; | ||
import { convertNoIgnoredError } from "./ruleConverters/eslint-plugin-rxjs/no-ignored-error"; | ||
import { convertNoIgnoredNotifier } from "./ruleConverters/eslint-plugin-rxjs/no-ignored-notifier"; | ||
import { convertNoIgnoredObservable } from "./ruleConverters/eslint-plugin-rxjs/no-ignored-observable"; | ||
import { convertNoIgnoredReplayBuffer } from "./ruleConverters/eslint-plugin-rxjs/no-ignored-replay-buffer"; | ||
import { convertNoIgnoredSubscribe } from "./ruleConverters/eslint-plugin-rxjs/no-ignored-subscribe"; | ||
import { convertNoIgnoredSubscription } from "./ruleConverters/eslint-plugin-rxjs/no-ignored-subscription"; | ||
import { convertNoIgnoredTakeWhileValue } from "./ruleConverters/eslint-plugin-rxjs/no-ignored-takewhile-value"; | ||
import { convertNoImplicitAnyCatch } from "./ruleConverters/eslint-plugin-rxjs/no-implicit-any-catch"; | ||
|
@@ -88,11 +98,23 @@ import { convertNoInternal } from "./ruleConverters/eslint-plugin-rxjs/no-intern | |
import { convertNoNestedSubscribe } from "./ruleConverters/eslint-plugin-rxjs/no-nested-subscribe"; | ||
import { convertNoRedundantNotify } from "./ruleConverters/eslint-plugin-rxjs/no-redundant-notify"; | ||
import { convertNoShareReplay } from "./ruleConverters/eslint-plugin-rxjs/no-sharereplay"; | ||
import { convertNoSubclass } from "./ruleConverters/eslint-plugin-rxjs/no-subclass"; | ||
import { convertNoSubjectUnubscribe } from "./ruleConverters/eslint-plugin-rxjs/no-subject-unsubscribe"; | ||
import { convertNoSubjectValue } from "./ruleConverters/eslint-plugin-rxjs/no-subject-value"; | ||
import { convertNoTap } from "./ruleConverters/eslint-plugin-rxjs/no-tap"; | ||
import { convertNoToPromise } from "./ruleConverters/eslint-plugin-rxjs/no-topromise"; | ||
import { convertNoUnboundMethods } from "./ruleConverters/eslint-plugin-rxjs/no-unbound-methods"; | ||
import { convertNoUnsafeCatch } from "./ruleConverters/eslint-plugin-rxjs/no-unsafe-catch"; | ||
import { convertNoUnsafeFirst } from "./ruleConverters/eslint-plugin-rxjs/no-unsafe-first"; | ||
import { convertNoUnsafeSubjectNext } from "./ruleConverters/eslint-plugin-rxjs/no-unsafe-subject-next"; | ||
import { convertNoUnsafeSwitchmap } from "./ruleConverters/eslint-plugin-rxjs/no-unsafe-switchmap"; | ||
import { convertNoUnsafeTakeUntil } from "./ruleConverters/eslint-plugin-rxjs/no-unsafe-takeuntil"; | ||
import { convertPreferAngularAsyncPipe } from "./ruleConverters/eslint-plugin-rxjs/prefer-angular-async-pipe"; | ||
import { convertPreferAngularComposition } from "./ruleConverters/eslint-plugin-rxjs/prefer-angular-composition"; | ||
import { convertPreferAngularTakeuntil } from "./ruleConverters/eslint-plugin-rxjs/prefer-angular-takeuntil"; | ||
import { convertPreferObserver } from "./ruleConverters/eslint-plugin-rxjs/prefer-observer"; | ||
import { convertSuffixSubjects } from "./ruleConverters/eslint-plugin-rxjs/suffix-subjects"; | ||
import { convertThrowError } from "./ruleConverters/eslint-plugin-rxjs/throw-error"; | ||
import { convertCognitiveComplexity } from "./ruleConverters/eslint-plugin-sonarjs/cognitive-complexity"; | ||
import { convertConsecutiveOverloads } from "./ruleConverters/eslint-plugin-sonarjs/consecutive-overloads"; | ||
import { convertMaxSwitchCases } from "./ruleConverters/eslint-plugin-sonarjs/max-switch-cases"; | ||
|
@@ -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], | ||
["rxjs-just", convertJust], | ||
["rxjs-no-async-subscribe", convertNoAsyncSubscribe], | ||
["rxjs-no-compat", convertNoCompat], | ||
["rxjs-no-connectable", convertNoConnectable], | ||
["rxjs-no-create", convertNoCreate], | ||
["rxjs-no-do", convertNoTap], | ||
["rxjs-no-explicit-generics", convertNoExplicitGenerics], | ||
["rxjs-no-exposed-subjects", convertNoExposedSubjects], | ||
["rxjs-no-finnish", convertNoFinnish], | ||
["rxjs-no-ignored-error", convertNoIgnoredError], | ||
["rxjs-no-ignored-notifier", convertNoIgnoredNotifier], | ||
["rxjs-no-ignored-observable", convertNoIgnoredObservable], | ||
["rxjs-no-ignored-replay-buffer", convertNoIgnoredReplayBuffer], | ||
["rxjs-no-ignored-subscribe", convertNoIgnoredSubscribe], | ||
["rxjs-no-ignored-subscription", convertNoIgnoredSubscription], | ||
["rxjs-no-ignored-takewhile-value", convertNoIgnoredTakeWhileValue], | ||
["rxjs-no-implicit-any-catch", convertNoImplicitAnyCatch], | ||
|
@@ -532,11 +565,23 @@ export const ruleConverters = new Map([ | |
["rxjs-no-nested-subscribe", convertNoNestedSubscribe], | ||
["rxjs-no-redundant-notify", convertNoRedundantNotify], | ||
["rxjs-no-sharereplay", convertNoShareReplay], | ||
["rxjs-no-subclass", convertNoSubclass], | ||
["rxjs-no-subject-unsubscribe", convertNoSubjectUnubscribe], | ||
["rxjs-no-subject-value", convertNoSubjectValue], | ||
["rxjs-no-tap", convertNoTap], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Never mind, I guess (well, I hope so 😆) that I've figured out it by creating a merger. |
||
["rxjs-no-topromise", convertNoToPromise], | ||
["rxjs-no-unbound-methods", convertNoUnboundMethods], | ||
["rxjs-no-unsafe-catch", convertNoUnsafeCatch], | ||
["rxjs-no-unsafe-first", convertNoUnsafeFirst], | ||
["rxjs-no-unsafe-subject-next", convertNoUnsafeSubjectNext], | ||
["rxjs-no-unsafe-switchmap", convertNoUnsafeSwitchmap], | ||
["rxjs-no-unsafe-takeuntil", convertNoUnsafeTakeUntil], | ||
["rxjs-prefer-angular-async-pipe", convertPreferAngularAsyncPipe], | ||
["rxjs-prefer-angular-composition", convertPreferAngularComposition], | ||
["rxjs-prefer-angular-takeuntil", convertPreferAngularTakeuntil], | ||
["rxjs-prefer-observer", convertPreferObserver], | ||
["rxjs-suffix-subjects", convertSuffixSubjects], | ||
["rxjs-throw-error", convertThrowError], | ||
["semicolon", convertSemicolon], | ||
["space-before-function-paren", convertSpaceBeforeFunctionParen], | ||
["space-within-parens", convertSpaceWithinParens], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertBanObservables: RuleConverter = ({ ruleArguments }) => { | ||
return { | ||
rules: [ | ||
{ | ||
...(ruleArguments.length !== 0 && { ruleArguments }), | ||
ruleName: "rxjs/ban-observables", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertBanOperators: RuleConverter = ({ ruleArguments }) => { | ||
return { | ||
rules: [ | ||
{ | ||
...(ruleArguments.length !== 0 && { ruleArguments }), | ||
ruleName: "rxjs/ban-operators", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertFinnish: RuleConverter = ({ ruleArguments }) => { | ||
return { | ||
rules: [ | ||
{ | ||
...(ruleArguments.length !== 0 && { ruleArguments }), | ||
ruleName: "rxjs/finnish", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertJust: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "rxjs/just", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoCompat: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "rxjs/no-compat", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoConnectable: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "rxjs/no-connectable", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoExplicitGenerics: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "rxjs/no-explicit-generics", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoIgnoredError: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "rxjs/no-ignored-error", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoIgnoredObservable: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "rxjs/no-ignored-observable", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoIgnoredSubscribe: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "rxjs/no-ignored-subscribe", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoSubclass: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "rxjs/no-subclass", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoTap: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleArguments: [{ tap: true }], | ||
ruleName: "rxjs/ban-operators", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoToPromise: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "rxjs/no-topromise", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoUnsafeCatch: RuleConverter = ({ ruleArguments }) => { | ||
return { | ||
rules: [ | ||
{ | ||
...(ruleArguments.length !== 0 && { ruleArguments }), | ||
ruleName: "rxjs/no-unsafe-catch", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoUnsafeFirst: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "rxjs/no-unsafe-first", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoUnsafeSwitchmap: RuleConverter = ({ ruleArguments }) => { | ||
return { | ||
rules: [ | ||
{ | ||
...(ruleArguments.length !== 0 && { ruleArguments }), | ||
ruleName: "rxjs/no-unsafe-switchmap", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertPreferAngularAsyncPipe: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "prefer-async-pipe", | ||
}, | ||
], | ||
plugins: ["rxjs-angular"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertPreferAngularComposition: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "prefer-composition", | ||
}, | ||
], | ||
plugins: ["rxjs-angular"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertPreferAngularTakeuntil: RuleConverter = ({ ruleArguments }) => { | ||
return { | ||
rules: [ | ||
{ | ||
...(ruleArguments.length !== 0 && { ruleArguments }), | ||
ruleName: "prefer-takeuntil", | ||
}, | ||
], | ||
plugins: ["rxjs-angular"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertPreferObserver: RuleConverter = ({ ruleArguments }) => { | ||
return { | ||
rules: [ | ||
{ | ||
...(ruleArguments.length !== 0 && { ruleArguments }), | ||
ruleName: "rxjs/prefer-observer", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertSuffixSubjects: RuleConverter = ({ ruleArguments }) => { | ||
return { | ||
rules: [ | ||
{ | ||
...(ruleArguments.length !== 0 && { ruleArguments }), | ||
ruleName: "rxjs/suffix-subjects", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-rxjs"], | ||
}; | ||
}; |
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 got me confused for a bit: there's both
finnish
andno-finnish
as separate rules. Got it!