Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Open
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I havesearched for related issues and found none that match my proposal.
- I have searched thecurrent rule list and found no rules that match my proposal.
- I haveread the FAQ and my problem is not listed.
Relevant Package
eslint-plugin
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
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
importtseslintfrom'typescript-eslint';exportdefaulttseslint.config({files:['**/*.ts'],extends:[tseslint.configs.base],});
eslint ./index.ts --debug
Expected Result
no eslint rules loaded
Actual Result
... eslint:rules Loading rule'consistent-return' (remaining=289) +0ms eslint:rules Loading rule'dot-notation' (remaining=288) +13ms eslint:rules Loading rule'init-declarations' (remaining=287) +5ms eslint:rules Loading rule'max-params' (remaining=286) +1ms eslint:rules Loading rule'no-dupe-class-members' (remaining=285) +16ms eslint:rules Loading rule'no-empty-function' (remaining=284) +4ms eslint:rules Loading rule'no-invalid-this' (remaining=283) +10ms eslint:rules Loading rule'no-loop-func' (remaining=282) +1ms eslint:rules Loading rule'no-loss-of-precision' (remaining=281) +1ms eslint:rules Loading rule'no-magic-numbers' (remaining=280) +1ms eslint:rules Loading rule'no-restricted-imports' (remaining=279) +15ms eslint:rules Loading rule'no-unused-expressions' (remaining=278) +32ms eslint:rules Loading rule'no-useless-constructor' (remaining=277) +2ms eslint:rules Loading rule'prefer-destructuring' (remaining=276) +7ms ...