I’m trying to use the internal rule deprecation
from SonarJS
, but there are unexpected deprecation warnings reported.
It works like the deprecated tslint
's same rule which reports warnings too.
related
// test.ts
export interface PartialObserver<T> {
value: T
}
export interface Subscription {
unsubscribe(): void
}
export declare class TestCase<T = unknown> {
subscribe(observer?: PartialObserver<T>): Subscription
/** @deprecated Use an observer instead of a complete callback */
subscribe(
next: null | undefined,
error: null | undefined,
complete: () => void,
): Subscription
/** @deprecated Use an observer instead of an error callback */
subscribe(
next: null | undefined,
error: (error: unknown) => void,
complete?: () => void,
): Subscription
/** @deprecated Use an observer instead of a complete callback */
subscribe(
next: (value: T) => void,
error: null | undefined,
complete: () => void,
): Subscription
subscribe(
next?: (value: T) => void,
error?: (error: unknown) => void,
complete?: () => void,
): Subscription
}
import { interval } from 'rxjs'
import { TestCase } from './test'
interval(1000).subscribe() // deprecation reported here
new TestCase<number>().subscribe() // not reported which is expected