Skip to content

πŸ“Ž organizedImports options should error on unknown predefined groupsΒ #10185

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.

Activity

  1. added this to the Biome v3 milestone on May 1, 2026
  2. added theissue type on May 1, 2026
  3. added
    S-Enhancement
    S-breaking-change
    on May 1, 2026
  4. ematipico commented on May 1, 2026

    @ematipico
    Member

    Why would that be a breaking change? That seems more like a bug

  5. Conaclos commented on May 1, 2026

    @Conaclos
    MemberAuthor

    Why would that be a breaking change?

    Because it could make a previously valid user config invalid?

    I am fine making it a bug, I just thought since the start it was a breaking change.

  6. ematipico commented on May 1, 2026

    @ematipico
    Member

    Because it could make a previously valid user config invalid?

    Have you identified a valid case? The initial issue doesn't say much on that regard

  7. Conaclos commented on May 1, 2026

    @Conaclos
    MemberAuthor

    Have you identified a valid case?

    No. I just mean that a user could create a config with unknown predefined groups that just got ignored. And if we start erroring on them, then they have to remove these useless (invalid) groups.
    I guess we could create a migration that removes them automatically.

    Do you think it is an acceptable change?

  8. ematipico commented on May 1, 2026

    @ematipico
    Member

    I think it is an acceptable, it's an invalid configuration that we didn't catch, so it's a bug on our side.

    We could add a warning in the changeset that this could be a potential breaking change because it spots invalid configuration.

    If it might feel you better, we could land it as a minor. As per migration I don't have strong feelings, it's definitely more helpful.

  9. removed this from the Biome v3 milestone on May 1, 2026
  10. added
    S-Bug-confirmed
    and removed
    S-breaking-change
    S-Enhancement
    on May 1, 2026
  11. self-assigned this
    on May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

S-Bug-confirmed

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions