Skip to content

linter: Type aware template literal check exponentially slow #20733

@aleksanderkatan

Description

@aleksanderkatan

What version of Oxlint are you using?

1.57.0

What command did you run?

oxlint --type-aware

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

I have no config file

What happened?

The linter works correctly, however it takes an unreasonable amount of time for it to finish.
Here is a repro. In practice, I came across this when trying to stringify a node from tinyest, my CI took 6 hours until somebody killed it.

The longer the type alternative, the longer execution, on my machine:

  • length 1-7 takes ~200ms,
  • length 8 takes 500ms,
  • length 9 takes 3000ms,
  • length 10 takes 28000ms,
  • length 11 takes 315700ms.

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