Skip to content

linter: auto-fix for eslint/arrow-body-style removes comments #22833

@JacksonMcKay

Description

@JacksonMcKay

What version of Oxlint are you using?

1.67.0

What command did you run?

oxlint --fix

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

{
  "categories": {
    "correctness": "off"
  },
  "rules": {
    "eslint/arrow-body-style": "error"
  }
}

What happened?

eslint/arrow-body-style auto-fix causes comments to be removed. e.g.

// Before `oxlint --fix`
const something = () => {
  // An important comment ⚠️
  return "something";
};

// After `oxlint --fix`
const something = () => "something";

The ESLint output is closer to what was expected:

// After `eslint --fix`
const something = () => 
  // An important comment ⚠️
   "something"
;

A minimal eslint.config.js to reproduce the above (using eslint 10.4.0):

export default {
  rules: { "arrow-body-style": "error" },
  files: ["**/*.ts"],
};

Metadata

Metadata

Assignees

No one assigned

    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