-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Enhancement: Support Lazy Loading Rules #11029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't know if we can do this. In the past eslint's own API eagerly loaded all of the rules for each plugin because it would eagerly iterate the plugin's I filed this with eslint core a whole back and I don't know if they ever changed their implementation. If they have then we could finally rework things to lazily load rules. |
Ooh yes lazy-loading rules would be wonderful. This is such a universally useful request I don't think it should be specific typescript-eslint - I think core and every plugin should be ideally do it. Looking back through the filing history...
I think this should be filed on ESLint core then. What do you all think? |
Eslint core can't do anything here - the plugins all need to manually set it up with a proxy or something. If someone was to build a reusable package that made it easy to export a lazy loaded rule map though...... Might be a good thing for us to build and publish as a package...? |
Hmm, it would be nice if ESLint core provided its own
Back in typescript-eslint: this ties into #10383. We've been wanting to do this for a bit but haven't had the time. It's definitely something we'd love to tackle eventually... but will take a lot of time and dependency shuffling. In the meantime, I think having a standalone plugin-creator package would be a great first step and something we can keep extracted out on its own. Proposal: let's wait until discussion in eslint/rewrite#176 settles? If ESLint core is up for creating a plugin utils package then I'd think we'd want to wait until their API settles before taking any action. |
Marking as blocked pending resolution to eslint/rfcs#132. Whether & how ESLint provides a lazy-loading rules in its |
Before You File a Proposal Please Confirm You Have Done The Following...
Relevant Package
eslint-plugin
My proposal is suitable for this project
Description
I propose the addition of lazy loading support for rule definitions. As the number of rules grows, it becomes increasingly inefficient to load them all at once. Currently, all rules are loaded eagerly, which can lead to unnecessary memory usage and slower startup times, especially for configurations that use only a subset of rules (e.g., non-type-checking). Additionally, the lack of this mechanism breaks the lazy loading already implemented in the ESLint repository - all rules in the current repository that use the getESLintCoreRule utility eagerly load core rules.
Additional Info
ESLint Config
eslint ./index.ts --debug
Expected Result
no eslint rules loaded
Actual Result
The text was updated successfully, but these errors were encountered: