Clarification of bracketSpacing option
See original GitHub issueI’m not 100% sure what the bracketSpacing config does.
These explanations:
// Controls the printing of spaces inside object literals
from the README.md// Controls the printing of spaces inside arrays and objects
from the atom package settings page
When using, the following code:
// source:
let list = [{
name: "foo",
value: "bar"
},{
name: "bar",
value: "baz"
}];
The output is always the same, wether bracketSpacing
is used or not (cli or atom plugin):
// output:
let list = [
{
name: "foo",
value: "bar"
},
{
name: "bar",
value: "baz"
}
];
I’m assuming I’m just expecting something its not designed to do. With bracketSpacing
disabled, I would have expected it to stay more dense. Any clarification would be great. Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Options - Prettier
Bracket Spacing. Print spaces between brackets in object literals. Valid options: true - Example: { foo: bar } .
Read more >Typescript eslint-prettier puts space before and after in angled ...
... reason because I almost tried every single prettier option, disabled bracketSpacing etc. no chance. Anyone knows why is this happening?
Read more >prettier - npm
Run prettier through the CLI with this script. Run it without any arguments to see the options. To format a file in-place, use...
Read more >Blog - BracketSpace
This tutorial covers only Email carriers (in case you are interested in a different carrier you can see our tutorials here). The next...
Read more >Configure Eslint, Prettier and Husky for WordPress Development
A brief explanation of ESLint options ... singleQuote: true trailingComma: es5 bracketSpacing: true parenSpacing: true jsxBracketSameLine: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
People are pretty opinionated about trailing commas, and I think it’s worth having it as an option. However, I am open to removing the
bracketSpacing
option. I haven’t seen many people talk about it or use it. I think it’s mainly there because recast had that option.Making trailing commas the default seems like a good idea! @jlongster we could use that option for the es7 trailing commas. I don’t think that trailing commas are very controversial