sourceCode.isSpaceBetweenTokens() and multiline comments
See original GitHub issueNoticed this while working on #12259
sourceCode.isSpaceBetweenTokens()
sees newlines inside multiline block comments as spaces.
Observable:
/* eslint space-before-function-paren:["error", "never"]*/
function foo/*
*/(){}
The above is an error because of the newline (function foo/* */(){}
is not an error for the same rule.)
Is it intentional or a bug?
There is no such test for isSpaceBetweenTokens()
in source-code
tests.
Also, when I add the s
flag to the /\/\*.*?\*\//gu
regex in isSpaceBetweenTokens
and run npm test
everything still works.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:7 (7 by maintainers)
Top Results From Across the Web
C++ single line comments followed by \ transforms in multiline ...
Each instance of a backslash character () immediately followed by a new-line character is deleted, splicing physical source lines to form logical source...
Read more >2. Lexical analysis — Python 3.11.1 documentation
This chapter describes how the lexical analyzer breaks a file into tokens. Python reads program text as Unicode code points; the encoding of...
Read more >Three Types of Comments in Java: Javadoc, Single-line and ...
Java's single line and multi-line comments are collectively called implementation comments, while Javadoc comments are called documentation comments.
Read more >How whitespace is handled by HTML, CSS, and in the DOM
Whitespace is any string of text composed only of spaces, tabs or line breaks (to be precise, CRLF sequences, carriage returns or line...
Read more >Lexical Structure - Python in a Nutshell, 2nd Edition [Book]
You may freely use whitespace between tokens to separate them. Some whitespace separation is necessary between logically adjacent identifiers or keywords; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems like a bug to me.
@kaicataldo Feel free to claim this 😃
The effects of this change can be also observed in the current version of
template-tag-spacing
, it will have more and fewer errors in some cases.