-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Warn constructor of class when classPropertiesAllowed is true #29
Comments
I think we're having the same issue. Here is an example. class Foo {
constructor(private readonly s: string) {
}
foo = (): string => {
return this.s
}
} Which gives me this error
Here are our versions:
Let me know if I can provide any more information ^_^ |
For a fix, I think you can just add kind != 'constructor' here: https://github.com/JamieMason/eslint-plugin-prefer-arrow-functions/blob/main/src/prefer-arrow-functions.ts#L268 |
mitchell-merry
added a commit
to mitchell-merry/eslint-plugin-prefer-arrow-functions
that referenced
this issue
May 23, 2024
mitchell-merry
added a commit
to mitchell-merry/eslint-plugin-prefer-arrow-functions
that referenced
this issue
May 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Constructor of class cannot be an arrow function, so, I think we need ignore it.
I use Typescript 5+ and eslint 8+
The text was updated successfully, but these errors were encountered: