Skip to content

linter: typescript/consistent-generic-constructors fixer is producing invalid code #18744

@connorshea

Description

@connorshea

What version of Oxlint are you using?

main

What command did you run?

No response

What does your .oxlintrc.json config file look like?

N/A

What happened?

Looks like the main branch has a panic due to one of the new fixers committed recently: https://github.com/oxc-project/oxc-ecosystem-ci/actions/runs/21530695928

First instance I can see was Jan 27, 2026 at 6am UTC https://github.com/oxc-project/oxc-ecosystem-ci/actions/runs/21386579703

3b7f260 seems like the most likely culprit, based on the diff for https://github.com/oxc-project/oxc-ecosystem-ci/actions/runs/21386579703/job/61564553140

A simpler example, if we try to fix this code it will result in invalid syntax:

foo({ bar: 'all' });
const baz: Map<number, number> = new Map();
Linter fixer produced invalid syntax.

Input code: 
```
foo({ bar: 'all' });
             const baz: Map<number, number> = new Map();
```

Fixed code: 
```
foo({ bar = new Map<number, number>();
```

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