forked from eslint/eslint
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ljharb what if:
let firstExtraStatement = null;
right below line 42.firstExtraStatement = node;
.firstExtraStatement
as the node.firstExtraStatement
.Program:exit
handler that would report one more time iffirstExtraStatement
is truthy. This would handle the case where the last line has too many statements, and there aren't any statements later on to trigger the report.firstExtraStatement
into a helper to consolidate that behavior.This would delay reporting until all statements on a line have been counted, but it would still report the location of the first extra node.
Would that work?