What is the ESLint rule to prevent newline after an object prop colon

邮差的信 提交于 2019-12-10 13:51:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!