My ESLint rule setup includes the following:
"vue/script-indent": [
"error",
4,
{
"baseIndent": 1,
"switchCase": 1,
"ignores":
[
"[init.type=\"ObjectExpression\"]",
"[init.type=\"ArrayExpression\"]"
]
}
]
However, I want to exclude indentation for cases where an object key's value is another object.
When linted, the code looks like this:
let example =
{
example:
{
test:
"test"
}
}
But I prefer the nested object to remain untouched, appearing like this instead:
let example =
{
example:
{
test:
"test"
}
}
Essentially, I want objects within objects to be ignored. Additionally, I also want arrays within objects to be ignored, hence why my configuration includes Object and Array in the ignore list.