Skip to content

sourceCode.isSpaceBetweenTokens() and multiline comments #12263

@mdjermanovic

Description

@mdjermanovic

Noticed 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/*
*/(){}

Demo link

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    HacktoberfestRecommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlycoreRelates to ESLint's core APIs and featureshelp wantedThe team would welcome a contribution from the community for this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions