Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Add options to accept empty objects with option whitespace check-postbrace #4552

Closed
Elrendio opened this issue Feb 27, 2019 · 2 comments
Closed
Labels
Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier Resolution: Duplicate Type: Rule Enhancement

Comments

@Elrendio
Copy link

Feature request

Is your feature request that we implement a new rule?
No

Is your feature request related to a problem? Please describe.
I would like to allow the use of let o = {} while enforcing a whitespace in let o = { foo: "bar" }.
Currently in order to have the latter you'll be force to use let o = { }.

Describe the solution you'd like
I would like to add an option allow-empty-object to the rule whitespace.

Describe alternatives you've considered
Not a lot, I think that should be the job of the linter. I have read your source code and I probably should be able to submit a PR.

Additional context
null

@JoshuaKGoldberg JoshuaKGoldberg added Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier Type: Rule Enhancement labels Mar 2, 2019
@JoshuaKGoldberg
Copy link
Contributor

This is a subset of #1044 and similar to #1045, which have been closed (see #4534).

You're welcome to tackle this in typescript-eslint or the eslint repository, or fork the whitespace rule and publish it with this option as a separate npm package.

(for what it's worth, the allow-empty-object option seems reasonable if you're not on Prettier)

@FrancescoBorzi
Copy link

it looks like allow-empty-object does not exist anymore

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier Resolution: Duplicate Type: Rule Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants