问题
I searched and search on both SO and Google. But I cannot find the rule to enforce this:
NOT OK
const object = {
methods:
{
}
}
OK
const object = {
methods: {
}
}
It seems to not be object-property-newline or object-curly-newline
Edit:
it also doesn't seem to be brace-style.
回答1:
There is no rule for that. You may propose this rule in to the eslint project, but I expect it would not be accepted.
In the meanwhile eslint-plugin-prettier
do cover this case, but it is not possible to opt-in only this case.
来源:https://stackoverflow.com/questions/56352612/what-is-the-eslint-rule-to-prevent-newline-after-an-object-prop-colon