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

[fix] `prefer-stateless-function`: avoid crash on ts empty constructor #2582

Merged
merged 1 commit into from Mar 3, 2020

Conversation

@golopot
Copy link
Contributor

golopot commented Mar 1, 2020

fixes #2187

Typescript allows constructor without body, like

class Foo {
  constructor(a)
}

This PR adds a null check to avoid crash.

Fixes #2187
}
}
`,
parser: parsers.TYPESCRIPT_ESLINT

This comment has been minimized.

Copy link
@golopot

golopot Mar 1, 2020

Author Contributor

This is valid test case, similar to the two cases above in line 138 - 156.

@golopot
Copy link
Contributor Author

golopot commented Mar 1, 2020

The build is failing for unrelated reasons.

@golopot
Copy link
Contributor Author

golopot commented Mar 1, 2020

Blocked by #2583.

@ljharb
ljharb approved these changes Mar 1, 2020
@ljharb ljharb force-pushed the golopot:fix-crash-empty-constructor-in-ts branch from 5299132 to 5959b5f Mar 3, 2020
@ljharb ljharb merged commit 5959b5f into yannickcr:master Mar 3, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 97.608%
Details
@golopot golopot deleted the golopot:fix-crash-empty-constructor-in-ts branch Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.