-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
enhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginformattingRelated to whitespace/bracket formatting. We strongly recommend you use a formatter instead.Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-pluginwontfixThis will not be worked onThis will not be worked on
Description
Possibly as part of type-annotation-spacing, possible as a new rule. Right now, the punctuation that I can think of are |
(union), &
(intersection), []
(array or tuple), and {}
(anonymous object definition).
The obvious preferences I can see for |
and &
are no-spaces (string|number
) and spaces (string | number
). Tuples and anonymous types are a bit different -- the two relevant spaces are after [
and before ]
, but not before [
or after ]
. A more real-world-y example might be:
type keyedEntity = baseEntity & { primaryKey: string|number; records: [ number, string ][]; };
This could be formatted a number of different ways.
sindresorhus, antfu, ipcjs, fregante, elszczepano and 2 more
Metadata
Metadata
Assignees
Labels
enhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginformattingRelated to whitespace/bracket formatting. We strongly recommend you use a formatter instead.Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-pluginwontfixThis will not be worked onThis will not be worked on