Skip to content

Change Request: [flat config] re-read the eslint.config.js file if it has been changed #16576

@alexander-doroshko

Description

@alexander-doroshko

ESLint version

8.28.0

What problem do you want to solve?

Hi from JetBrains! WebStorm ESLint integration has a wrapper Node.js process that lives for a long time and calls ESLint.lintText() as needed. ESLint config files might be edited between ESLint.lintText() calls.

In the 'flat config' mode, the eslint.config.js files are never re-read from disk. The reason is that they are loaded using import(), which caches the result forever.

So, the problem is that the ESLint results that WebStorm users see do not match the current configuration (eslint.config.js files).

Cleaning require.cache doesn't help. It looks like there's no way to drop the internal cache of import().

What do you think is the correct solution?

It would be great if the loadFlatConfigFile() function returned up-to-date result each time even if the config file has been edited between loadFlatConfigFile() invocations. Thank you!

Participation

  • I am willing to submit a pull request for this change.

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussioncoreRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLint

    Type

    No type

    Projects

    Status

    Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions