我希望能够格式化我的代码,如下所示:
const {
header,
note,
otherStuff
} = labels;
const { thisDestructuredObject } = _.get(labels,`some.thing.here`,`some.default.value`);
Eslint的格式如下:
const {
header, note, otherStuff
} = labels;
const { thisDestructuredObject } = _.get(labels,
`some.thing.here`,
`some.default.value`);
但是,我同时设定了两个规则:
"function-paren-newline": ["error", { "minItems": 4 }],
"object-curly-newline": [
"error",
{
"ObjectExpression": { "multiline": true, "minProperties": 2 },
"ObjectPattern": { "multiline": true, "minProperties": 2 },
"ImportDeclaration": "never",
"ExportDeclaration": { "multiline": true, "minProperties": 3 }
}
]
我为React
启用了预设,并为ESLint推荐了设置。
此外,还设置了React
和React-hooks
的插件。
有人试图做这样的事情吗?