This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
Consider using @typescript-eslint/class-methods-use-this
#344
Comments
slifty
added a commit
to slifty/aprilbot
that referenced
this issue
Apr 2, 2024
This boilerplate creates some basic AprilBot functionality for connecting to slack and handling some basic types of interactions. I had to create types for the event handlers for now, though I opened an issue in the Slack sdk in the hopes they might add types [1] to their events. This also swaps out the class-methods-use-this lint rule for a smarter variety, which is probably something that the upstream maintainer should consider adding as well [2]. [1] slackapi/node-slack-sdk#1768 [2] iamturns/eslint-config-airbnb-typescript#344
Kenneth-Sills
added a commit
to Kenneth-Sills/eslint-config-airbnb-typescript-original
that referenced
this issue
Aug 5, 2024
By default, this does not deviate in behavior from the original rule. It does, however, provide users with additional configuration options to disable errors when `this` is not used in classes that implement interfaces or methods that explicitly override parent methods. The configuration we provide has been left at the default, though, since those rules are arguably over-permissive in the pursuit of not requiring type information. Closes iamturns#344.
Submitted PR #358 to swap the rule over. But the configuration options mentioned are still off by default.
|
jrolfs
pushed a commit
to jrolfs/eslint-config-airbnb-typescript
that referenced
this issue
Aug 16, 2024
By default, this does not deviate in behavior from the original rule. It does, however, provide users with additional configuration options to disable errors when `this` is not used in classes that implement interfaces or methods that explicitly override parent methods. The configuration we provide has been left at the default, though, since those rules are arguably over-permissive in the pursuit of not requiring type information. Closes iamturns#344.
This was referenced Aug 25, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
There is a new @typescript-eslint/class-methods-use-this rule which makes it possible to disable the rule in the case of overrides and interface.
For example, using this (with the updated options) prevents the pesky situation where an abstract class defines some abstract methods which do NOT necessarily use
this
, but which need to be class methods due to the abstract class definition.The text was updated successfully, but these errors were encountered: