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

Rule suggestion: No spaces in empty array/object declaration #555

Closed
LinusU opened this issue Jun 27, 2016 · 8 comments

Comments

@LinusU
Copy link
Member

commented Jun 27, 2016

I would like to propose a rule that prohibits writing empty objects as { } and instead enforces the shorter {} which I think is more commonly used. The same would be true for arrays, it should enforce [] instead of [ ].

Thoughts? If this is wanted I could probably whip up a pull request towards es-lint.

@yoshuawuyts

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2016

Not particularly fussed on this one, I'm fine with it either way

@LinusU

This comment has been minimized.

Copy link
Member Author

commented Jun 27, 2016

I would also be fine with either way, would prefer it if one of them was enforce though, and I have almost only seen without spaces being used in the community...

@dcousens

This comment has been minimized.

Copy link
Member

commented Jun 28, 2016

+1 for {}, I've almost never seen { } without it being a typo.

@feross

This comment has been minimized.

Copy link
Member

commented Jul 13, 2016

This sounds good to me. Surprised that this isn't already part of the object-curly-spacing rule.

@feross

This comment has been minimized.

Copy link
Member

commented Aug 19, 2016

@LinusU Can you open this as an issue on ESLint to see what the ESLint team thinks? There's nothing we can do in standard until there's a rule in ESLint, so I'm going to close this to keep only actionable issues in the issue tracker.

Once this is part of ESLint, I will notice it in the changelog when I upgrade the ESLint version or you can open an issue/PR to add the rule.

@feross feross closed this Aug 19, 2016

@LinusU

This comment has been minimized.

Copy link
Member Author

commented Oct 16, 2016

@feross

This comment has been minimized.

Copy link
Member

commented Jan 17, 2017

Re-opened as eslint/eslint#7927

@LinusU

This comment has been minimized.

Copy link
Member Author

commented Jan 17, 2017

Thank you ❤

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.