Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Support for negated ignore patterns

Aperta
#32 16 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@webpro ci sta già lavorando.

Dal 30/10/2024.

  • #70 di @webpro — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
tooling

Direzione di ricerca

Inizia individuando la gestione dell’opzione ignore da parte di tinyglobby e i test di globbing esistenti. Confronta l’esempio richiesto di pattern negato con il comportamento attuale, quindi definisci una copertura per preservare i percorsi esclusi e ripristinare .yarn/patches/index.js; il lavoro è completato quando l’input mostrato restituisce index.js e .yarn/patches/index.js.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement help wanted

Would be great to support negated patterns in the ignore option.

Use case: respect files like .gitignore (or others like .prettierignore etc) when globbing.

E.g. globby has the gitignore option which does the .gitignore reading, parsing and evaluation.

I wouldn't expect tinyglobby to include this feature (to read and parse such ignore files), but would be great to support negated ignore patterns so tinyglobby could be extended to support the use case.

The same has been requested in both node-glob and fast-glob, but neither of them currently supports it. Refs:

It would make migration more interesting for globby (with gitignore: true) users. Also I understand tinyglobby wants to stay tiny so feel free to reject!

Here's an example simplified use case to clarify things a bit. Let's say we want to glob all **/index.js files in a workspace that has this .gitignore:

.yarn/*
!.yarn/patches
...

And files:

.
├── index.js
└── .yarn
    ├── patches
    │   └── index.js
    └── index.js

After reading the .gitignore file(s) and converting the patterns the options look like this:

glob(["**/*.js"], {
  dot: true,
  ignore: ["**/.yarn/*", "!**/.yarn/patches/**"],
});

Expected result:

["index.js", ".yarn/patches/index.js"]

Just saying, for users to stuff it all into patterns argument directly is likely not a good idea. I think this doesn't and shouldn't work:

glob(["**/*.{js,ts}", "!.yarn", ".yarn/patches/**/*.{js,ts}"], { dot: true })
Lingua principale
TypeScript
Stelle
546
Fork
30
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SuperchupuDev/tinyglobby

Tutte le issue di SuperchupuDev/tinyglobby

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.