Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add further warnings on missing spaces in comments #2

Open
melloc opened this issue Aug 2, 2017 · 1 comment
Open

Add further warnings on missing spaces in comments #2

melloc opened this issue Aug 2, 2017 · 1 comment
Assignees

Comments

@melloc
Copy link
Contributor

melloc commented Aug 2, 2017

The spaced-comment rule doesn't warn by default when there isn't a space before */. ESLint 3.x introduced an option, "balanced", which enables warning when it's missing. When we move to a newer ESLint version, we'll want to update the configuration to look like:

module.exports = {
    "rules": {
        ...
        "spaced-comment": [
            "error",
            "always",
            {  
                "block": { "balanced": true }
            }
        ],
        ...
    }
};

Additionally, spaced-comment doesn't warn on lines in multiline comments that are missing a * or a space after a *. For example:

/*
foo
 */

/*
 *foo
 */

There is work being done on a multiline-comment-style option upstream to improve this.

@melloc melloc self-assigned this Aug 7, 2017
@melloc
Copy link
Contributor Author

melloc commented Dec 15, 2017

In #4, I updated the config to check both ends of block comments. Using multiline-comment-style will require some further investigation, since it forces multiline comments to be starred blocks, instead of just checking that starred blocks are formatted correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant