How to add spaces inside brackets of arrays on single line?
{
"items": [ "item1", "item2" ]
}
This is a prettier feature, It was decided to remove spacing in brackets / parens.
Duplicate of #35
You can read more about it in prettier/prettier#296
Thank you.
Forgot to mention, if you really want it, you can use 'eslintIntegration' with https://eslint.org/docs/rules/space-in-brackets
@CiGit thanks for the hints!
But with this settings in VSCode it does not work on formatting the document:
"eslint.enable": true,
"eslint.options": {
"rules": {
"array-bracket-spacing": ["error", "always", { "objectsInArrays": false }]
}
},
"prettier.eslintIntegration": true
Good point. We do not read from this settings.
You have to put them in a file .eslintrc
The same behavior when I place a .eslintrc file with this content in a directory of json files:
{
"rules": {
"array-bracket-spacing": ["always"]
}
}
My bad, I've read your initial post really badly. Thought it was JS not JSON.
Sadly, I've no workaround for you.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.