Skip to content

spaced-comment should allow line ending after markers #12036

@tiansh

Description

@tiansh

What rule do you want to change?
spaced-comment

Does this change cause the rule to produce more or fewer warnings?
fewer

How will the change be implemented? (New option, new default behavior, etc.)?
default behavior

Please provide some example code that this change will affect:

/* eslint spaced-comment: ["error", "always", { "line": { "markers": ["/", "#region", "#endregion"] } }] */
/* eslint no-trailing-spaces: ["error"] */

//#region blah
const answer = 42;
//#endregion

console.log(answer);

What does the rule currently do for this code?

6:1 error Expected space or tab after '//#endregion' in comment spaced-comment

using --fix cannot fix it (since there are no possible auto fix)

What will the rule do after it's changed?

pass without tip an error

Are you willing to submit a pull request to implement this change?

Maybe no


spaced-comment does allow line ending after // without using markers. And this behavior should be applied to markers too imo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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 incorrectlyruleRelates to ESLint's core rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions