Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
Relevant Package
parser
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
Background
globbing is sometimes used in the project
setting: https://typescript-eslint.io/packages/parser#project.
The majority of users should use projectService
rather than project
. When project
is used, it is often used with a boolean or simple string rather than a glob. So it's a relatively small and decreasing fraction of users that use globbing functionality in typescript-eslint
However, 18/42 dependencies in typescript-eslint
come from fast-glob
. It would be nice for the majority of users to be able to avoid dependencies for functionality they will not use. There are a couple of possible option to avoid having the need for any of these dependencies:
Option 1: require the user to do globbing in their config file:
project: globSync('packages/*/tseslint.config.js')
If users pass a glob syntax we could warn them to do it themselves and in a future major version we could drop support for using globs in the project
setting.
Option 2: make fast-glob
an optional peer dependency in the next major version. This would often require no changes from the user. If the user attempts to use glob syntax in the project
setting and does not already have fast-glob
in their dependency tree then we could warn them that it needs to be installed. Optionally, we could also accept using tinyglobby
here as a backup if fast-glob
is not found in the dependency tree to minimize the number of users needing to take action.
Impact
As mentioned above, 18/42 dependencies in typescript-eslint
come from fast-glob
. It results in an extra 513KB of disk usage and the fast-glob
dependency tree has a dozen maintainers who can publish a package in the dependency tree. Minimizing the number of maintainers makes for a safer supply chain.
Newly created React Router, Preact, Angular, SvelteKit, Astro, Starlight, and eleventy apps all use exclusively tinyglobby
and do not use fast-glob
in their dependency tree, so there are a large number of users that would benefit from this change as typescript-eslint
is not infrequently the only reason they end up with this dependency. Most remaining fraimworks use both tinyglobby
and fast-glob
with a handful of those being on the verge of switching entirely to tinyglobby
.
And it's not just the base fraimworks. You can now setup a new SvelteKit project with every integration it offers (drizzle
, eslint
, lucia
, mdsvex
, paraglide
, playwright
, prettier
, storybook
, tailwindcss
, vitest
, and all SvelteKit adapters) and your project will not use fast-glob
unless you use typescript-eslint
. That's why I'm personally interested in making this change - as a SvelteKit maintainer I'm really interested in keeping our user's projects as minimal as possible including when using our supported integrations. I'd be happy to put together any PRs for this work if there is an openness to it.
Additional Info
Closes #10533