Skip to content

📎 organizedImports options should error on unknown predefined groups #10185

@Conaclos

Description

@Conaclos

Description

organizedImports uses a dedicated syntax for predefined groups: all predefined groups are enclosed by two colons. For example :NODE:.
The option deserializer doesn't currently check if a name between two colons is actually a valid predefine group.
Thus, this doesn't catch misspelling.
For example, the following configuration is considered valid:

{
  "options": {
    "groups": [":NOD:", ":Bun:"]
  }
}

This task is about to error on unknown predefined groups.
For example using :NOD: or :NoDe: must emit a misconfiguration error.

We must also error on use of :BLANK_LINE: in a source matcher like in the following config:

{
  "options": {
    "groups": [{ "source": ["anything", ":BLANK_LINE:"] }]
  }
}

This is a breaking change.

Metadata

Metadata

Assignees

Labels

S-Bug-confirmedStatus: report has been confirmed as a valid bug

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions