'How to remove extra parentheses in prettier
I use .prettierrc with settings:
{
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"bracketSpacing": true,
"printWidth": 100,
"trailingComma": "none",
"arrowParens": "avoid",
"bracketSameLine": false
}
And he puts extra brackets like this in my Vue file:
@updateQuery="val => (query = val)"
But I need in:
@updateQuery="val => query = val"
What to do?
Solution 1:[1]
In an arrow function if you are making an assignment prettier will fix it like so:
val => (query = val)
There's nothing wrong with it.
You can find more info here https://github.com/prettier/prettier/pull/1326
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | PawFV |
