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 JSCS requireSpaceAfterComma rule #30

Closed
ntwb opened this issue Apr 17, 2016 · 4 comments
Closed

Add JSCS requireSpaceAfterComma rule #30

ntwb opened this issue Apr 17, 2016 · 4 comments

Comments

@ntwb
Copy link

ntwb commented Apr 17, 2016

http://jscs.info/rule/requireSpaceAfterComma http://eslint.org/docs/rules/comma-spacing

JSCS Rule: "requireSpaceAfterComma": true,

ESlint Rule: "comma-spacing"

I have the following JSCS rules in my jscsrc file:
"disallowSpaceBeforeComma": true,
"disallowTrailingComma": true,
"requireCommaBeforeLineBreak": true,
"requireSpaceAfterComma": true,

The resulting eslintrc is: "comma-spacing": [2, { "before": false }],

What I expected was "comma-spacing": [2,{ "before": false, "after": true }], or "comma-spacing": 2,

The comma-spacing rule includes some defaults: http://eslint.org/docs/rules/comma-spacing#options which is how I arrived at "comma-spacing": 2, via JSCS "disallowSpaceBeforeComma": true, and "requireSpaceAfterComma": true, rules.

"before": false (default) disallows spaces before commas
"before": true requires one or more spaces before commas
"after": true (default) requires one or more spaces after commas
"after": false disallows spaces after commas
@brenolf
Copy link
Owner

brenolf commented Apr 20, 2016

The base JSCS version used was v2.0.0, so this rule didn't exist by that time. I'll be implementing the missing rules I identified until v.3.0.2, as you can check here eslint/eslint#5856.

@ntwb
Copy link
Author

ntwb commented Apr 20, 2016

Awesome thanks for the explanation, pretty new, actually up until the JSCS team joined ESLint a couple of days ago I'd never touched JSCS so I'm not really up to date on all the versions...

brenolf added a commit that referenced this issue Apr 27, 2016
@ntwb
Copy link
Author

ntwb commented Apr 28, 2016

Just to follow up and confirm that with that latest version of polyjuice I do indeed get:
"comma-spacing": [2, { "before": false, "after": true }],

Which is what I expected in the original report, so thanks for the fix 👍

@brenolf
Copy link
Owner

brenolf commented Apr 28, 2016

Thanks for the follow up @ntwb!

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

No branches or pull requests

2 participants