Skip to content

Enhancement: replace globby with fast-glob #9453

Closed
@SukkaW

Description

@SukkaW

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

Relevant Package

typescript-estree

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

Previously, typescript-eslint switched from glob to globby for tsconfig.json file searching: #2418

Under the hood, globby is powered by fast-glob with extra features, but none of them are utilized by the typescript-eslint.

Since the typescript-eslint doesn't utilize those extra features, I propose replacing globby with fast-glob to reduce the installation size.

Additional Info

The installation size difference

The installation size of globby is 605 KiB and 23 transitive dependencies are introduced, while the installation size of fast-glob is 503 KiB and 18 transitive dependencies are introduced.

Proof of Concept

I've tested the proposal in my fork: SukkaW@0cec339 and all existing test cases are passed on my machine.

globby's extra features

Here is globby's feature description:

  • Promise API
    • fast-glob also has promise-based API, and typescript-eslint only uses the sync API
  • Multiple patterns
    • globby's multiple patterns support is powered by fast-glob directly
  • Negated patterns: ['foo*', '!foobar']
    • globby's negated patterns support is also powered by fast-glob directly
  • Expands directories: foo → foo/**/*
    • typescript-eslint doesn't rely on this feature since the exact matches of tsconfig.json (-like) files are required
  • Supports .gitignore and similar ignore config files
    • typescript-eslint doesn't rely on this feature since globby disabled this feature by default and typescript-eslint doesn't enable it.
  • Supports URL as cwd
    • Currently typescript-eslint passed the string path to cwd, and we can use Node.js built-in url.fileURLToPath in case we encounter URLs in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy