window.location.reload(); // no deprecation warning
const reload = window.location.reload; // deprecation warning is triggered
reload();
with tslint.json configuration:
{
"rules": {
"deprecation": true
}
}
As of typescript 3.2.1, window.location.reload(forcedReload: boolean) is deprecated, while the parameterless version is not. When linting the code, a direct call to reload() is ok. However, just accessing the function (as is, e.g., done in unit tests) triggers the deprecation warning.
No deprecation warning is triggered in the code above, because no deprecated functionality is used.
Hi, I'm faced to the same issue on my project when I'm trying to use functions overloads.
If I want to access the function without explicitly calling it, TSLint returns a warning.
The deprecation rule seems to be triggered when at least one overload is tagged as @deprecated.
class Foo {
/** @deprecated */
public bar(p1: number): any;
public bar(p1: string, p2: number): any;
public bar(...params: any) {
return params;
}
}
const myFoo = new Foo();
myFoo.bar(2); // deprecation warning => OK
myFoo.bar('2', 2); // no deprecation warning => OK
const myBar = myFoo.bar; // deprecation warning => Unexpected behavior
what is the status here? unfortunately my project is filled with deprecation warnings after the update.
are there any plans of resolving this soon?
would be awesome :)
@pkelleter it's accepting PRs, so as soon as someone has code that can fix the issue, we'd be happy to take it in. You're more than welcome to send that PR if you'd like! ๐
In the meantime, you can always disable the rule.
Which rule can i disable, please?
Is there a specific rule for that or do I have to disable tslint deprecations in generel then?
Unfortunately there is no way that I can come up with enough spare time to work myself into this project and fix it on my own :(
To disable it in your configuration: https://palantir.github.io/tslint/usage/configuration/
To disable it with inline comments: https://palantir.github.io/tslint/usage/rule-flags/
We got hit with this for every usage of RxJS's of. We are currently disabling like so:
// tslint:disable-next-line deprecation
of(..)
You could also set that rule to false in your configuration (we just still wanted to be able to use that rule elsewhere)
BTW there is a PR open for this that apparently needs some adjustments: https://github.com/palantir/tslint/pull/4649
If it's RxJS usage that is causing the warnings, update to their latest as
they removed their deprecated flag for of:
https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#bug-fixes
On Thu, Jun 6, 2019 at 8:13 AM Benjamin Charity notifications@github.com
wrote:
We got hit with this for every usage of RxJS's of. We're currently
disabling like so:// tslint:disable-next-line deprecation
of(..)You could also set that rule to false in your configuration (we just
still wanted to be able to use that rule elsewhere)
BTW there is a PR open for this that apparently needs some adjustments:
4649 https://github.com/palantir/tslint/pull/4649
โ
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/palantir/tslint/issues/4522?email_source=notifications&email_token=AAB527RD5EFWDE3Y5BBKY3DPZESTDA5CNFSM4GYJFATKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXDFQJY#issuecomment-499537959,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAB527WK5N6RYDTOITMHNN3PZESTDANCNFSM4GYJFATA
.
Ahh great find! Thanks!
TSLint is deprecated and no longer accepting pull requests other than security fixes. See #4534. โ ๏ธ
We recommend you instead use typescript-eslint to lint your TypeScript code with ESLint. โ
๐ It was a pleasure open sourcing with you!
๐ค Beep boop! ๐ TSLint is deprecated ๐ _(#4534)_ and you should switch to typescript-eslint! ๐ค
๐ This issue is being locked to prevent further unnecessary discussions. Thank you! ๐
Most helpful comment
If it's RxJS usage that is causing the warnings, update to their latest as
they removed their deprecated flag for of:
https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#bug-fixes
On Thu, Jun 6, 2019 at 8:13 AM Benjamin Charity notifications@github.com
wrote: