Skip to content
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

#29 Don't flag constructors when this is not present #36

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mitchell-merry
Copy link
Contributor

@mitchell-merry mitchell-merry commented May 23, 2024

Description (What)

Fixes #29.

Constructors like this:

class Obj {
  constructor(private readonly foo: number) {}
};

don't have this, so they get incorrectly flagged by the plugin. We should be sure to exclude all constructors from this rule.

Justification (Why)

Because constructors cannot be arrow functions.

How Can This Be Tested?

See tests, you can revert the fix to demonstrate that this change works.

@mitchell-merry
Copy link
Contributor Author

Looks like the node version needs to be bumped? https://github.com/JamieMason/eslint-plugin-prefer-arrow-functions/blob/main/.nvmrc I thought this was fixed... 😄

@mitchell-merry
Copy link
Contributor Author

Hi @JamieMason , could this be looked at please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn constructor of class when classPropertiesAllowed is true
1 participant