什么是ESLint规则以防止对象冒号后出现换行符 [英] What is the ESLint rule to prevent newline after an object prop colon
本文介绍了什么是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屋!
查看全文