Eslint: support single line style for exported comment

Created on 29 Jan 2017  路  3Comments  路  Source: eslint/eslint

What version are you using?
v3.14.1

What did you do?
Had an error for no-unused-vars, but my function was intended to be called by the browser. So I looked at the docs and found http://eslint.org/docs/rules/no-unused-vars#exported

So I added a comment like // exported variableName

What happened?
It did not fix the error, I had to change the comment to /* exported variableName */

What did you expect to happen?
I find it weird that eslint does not support both comment styles.

accepted archived due to age documentation enhancement good first issue help wanted

Most helpful comment

Hi! I would like to work on this issue. I will try to finish asap.

All 3 comments

Inline commands were added to support per-line operations. Since adding exported is a global operation, and doesn't target specific line it has to be block-level comment. I think we can updated documentation to make it clear that you have to use block comments.

In addition to @ilyavolodin's suggestion, I wonder if we should include a code example for clarity.

Hi! I would like to work on this issue. I will try to finish asap.

Was this page helpful?
0 / 5 - 0 ratings