Import Declaration Newline Rules Confusing/Not Documented Correctly
In the ESLint config, the object-curly-newline section configures a number of things that are not made clear in the text of the guide:
'object-curly-newline': ['error', {
ObjectExpression: { minProperties: 4, multiline: true, consistent: true },
ObjectPattern: { minProperties: 4, multiline: true, consistent: true },
ImportDeclaration: { minProperties: 4, multiline: true, consistent: true },
ExportDeclaration: { minProperties: 4, multiline: true, consistent: true },
}],
The only place this rule is mentioned in the guide is under 10.8, which states only that imports on newlines need to be indented. The following to things about this config are not made clear in the guide:
- The
minPropertiespart of the rule is not mentioned; it is not made clear that, after 4 properties, you must use newlines - The rule applied here for imports also applies to other objects
In addition, the code snippet in this section suggests that the rule is saying "put all of your imports from the same module on new lines", but the text says it is about indenting imports when they are put on new lines. I found this quite confusing.
While it's ideal for the guide to be a superset of the eslint config, as long as there's no contradictions, it's fine for things to be in the config that aren't in the guide.
If there's some prose that would be helpful, then we can certainly add it - but in practice this isn't really worth mentioning, since editors are typically configured to autofix on save, and this arbitrary number tends to feel intuitive.
Hello! Can I Work On This Issue. Thankyou.