Skip to content

linter: eslint/sort-keys group separation breaks on \r\n #21606

@Kirens

Description

@Kirens

What version of Oxlint are you using?

1.61.0

What command did you run?

oxlint example.js

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

{
  "plugins": ["oxc"],
  "rules": {
    "eslint/sort-keys": ["error", "asc", { "allowLineSeparatedGroups": true }]
  }
}

What happened?

The example below is a correct example of sort-keys with allowLineSeparatedGroups

var ok = {
  c: 1,
  d: 2,

  a: 3,
  b: 4,
};

However, if the code is using CRLF line breaks oxlint does not identify the two separeate groups and thus complains. This is a regression from eslint.

It seems the culprit is that groups are identified by two consecutive LF-characters:

if text_between.contains("\n\n") {

Metadata

Metadata

Assignees

Labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions