Skip to content

Bug: repeated lints in the same process run out of memory #6462

Closed
@sandersn

Description

@sandersn

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Issue Description

Expected: Repro should finish, printing memory usage that stays roughly about the same.
Actual: Memory usage grows throughout the run until the VM runs out of memory.

This happens even with all .eslintrc.json rules turned off, as long as typescript-eslint is specified as eslint's parser.

Probably related to #1192

Reproduction Repository Link

https://github.com/sandersn/ts-eslint-oom

Repro Steps

  1. clone the repo inside a folder like repros:
$ cd repros
$ git clone git@github.com:sandersn/ts-eslint-oom.git
  1. clone the Definitely Typed repo two levels up from ts-eslint-oom:
$ cd ..
$ git clone git@github.com:DefinitelyTyped/DefinitelyTyped.git --depth 1
$ cd DefinitelyTyped
$ npm i --no-package-lock

At least, I'm pretty sure a shallow clone will work here.
Yes, there is no package-lock.

  1. Back in ts-eslint-oom, run npm ci
  2. Then node index.js

2a. Optionally, delete all the rules in .eslintrc.json, since that shows that the problem is from typescript-eslint and not the rules. You may also need to delete all the override .eslintrc.jsons in subfolders.

ts-eslint-oom loops over every folder in DefinitelyTyped/types and calls eslint on it. The config at DT root specifies typescript-eslint as the parser.

Versions

package version
@typescript-eslint/eslint-plugin 5.52.0
@typescript-eslint/parser 5.52.0
@typescript-eslint/utils 5.52.0
ESLint 8.34.0
node 18 or 16

Metadata

Metadata

Assignees

Labels

accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions