4
Configuration for this rule is really complex. I think what you are looking for is something like this:
'key-spacing': [ 'error', {
'singleLine': {
'beforeColon' : false,
'afterColon' : true
},
"align": {
"beforeColon" : true,
"afterColon" : true,
"on" : "colon"
}
}]
However, even with this configuration, ESLint doesn’t allow for arbitrary location for colons. They have to be as close as possible to the longest key name in the object. So with the above configuration your code has to change to:
export default {
name : 'app',
components : {
todos
}
}
That will lint correctly with configuration I provided.
Source:stackexchange.com