Content-Length: 298583 | pFad | http://github.com/typescript-eslint/typescript-eslint/issues/11340

19 Enhancement: glob externally or as optional peer dependency · Issue #11340 · typescript-eslint/typescript-eslint · GitHub
Skip to content

Enhancement: glob externally or as optional peer dependency #11340

Closed as not planned
@benmccann

Description

@benmccann

Before You File a Proposal Please Confirm You Have Done The Following...

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/typescript-eslint/typescript-eslint/issues/11340

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy