Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Fix semicolon rule on last line without EOF line. #2696

Closed
wants to merge 2 commits into from

Conversation

mxl
Copy link
Contributor

@mxl mxl commented May 6, 2017

PR checklist

  • New bugfix
    • Includes tests

Overview of change:

Currently when using "semicolon": [true, "never"] rule if semicolon is used in last line without next EOF line then linting fails with error:

Warning: Cannot read property 'kind' of undefined

because here util.getNextToken() return value is not tested for undefined.

I put tests in separate directory and not in semicolon/never/test.ts.* to avoid accidental appending to that files that will ruin this test.

CHANGELOG.md entry:

[bugfix] semicolon

@ajafff
Copy link
Contributor

ajafff commented May 6, 2017

@mxl Thank you for taking the time to analyse and fix this bug.

Unfortunately that has already been done as part of a bigger change in #2655. That one also includes similar regression tests.

@mxl
Copy link
Contributor Author

mxl commented May 6, 2017

@ajafff Glad to hear that!

@mxl mxl closed this May 6, 2017
@mxl mxl mentioned this pull request May 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants