什么是ESLint规则以防止对象冒号后出现换行符 [英] What is the ESLint rule to prevent newline after an object prop colon

查看:1013
本文介绍了什么是ESLint规则以防止对象冒号后出现换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了SO和Google.但是我找不到执行此规则的规则:

I searched and search on both SO and Google. But I cannot find the rule to enforce this:

const object = {
  methods:
  {
  }
}

确定

const object = {
  methods: {
  }
}

它似乎不是 object-property-newline object-curly-newline

它似乎也不是括号样式.

推荐答案

没有规则.您可以在eslint项目中提出该规则,但我希望它不会被接受.

There is no rule for that. You may propose this rule in to the eslint project, but I expect it would not be accepted.

与此同时,eslint-plugin-prettier确实涵盖了这种情况,但是不可能仅选择加入这种情况.

In the meanwhile eslint-plugin-prettier do cover this case, but it is not possible to opt-in only this case.

这篇关于什么是ESLint规则以防止对象冒号后出现换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆