question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ignore patterns don't work in `ignore` option

See original GitHub issue

Environment

  • OS Version: ubuntu 17.10
  • Node.js Version: latest

Actual behavior

Ignore patterns don’t work in ignore option.

Expected behavior

Ignore patterns should be work in ignore option. node-glob works perfect.

Steps to reproduce

  1. Create file.txt with any contents.
  2. Create file.yaml with any contents.

Code sample

const fg = require('fast-glob');

fg(['**/*'], {
  absolute: true,
  dot: true,
  ignore: [`!{**/*,*}.txt`],
  onlyFiles: true
})
  .then((entries) => console.log(entries));

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
mrmlnccommented, Jun 11, 2022

Another issue about this functionality — #356.

Unfortunately, I could not come up with a decent algorithm that allowed me to implement this functionality without completely rewriting the pattern-matching mechanism when reading in depth.

I will try again later, after the major release of this package. Most likely, it’s time to reconsider the approach to how we process patterns in the pattern manager and their further application to directories.

I cannot promise any specific dates.

0reactions
devinrhode2commented, Jul 14, 2022

Negated patterns would be really nice for a package.json npm script like this:

"format:check:ci:non-ts": "yarn prettier --check '**/*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}'"

This helps ensure prettier format check is comprehensive, but doesn’t repeat what eslint may already be checking.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ignoring Code - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Ignore file patterns diff option does not work for untracked files
Independently of .gitignore, in the diff tab of the options menu, sourcetree has a setting to exclude certain file patterns from showing a...
Read more >
Default ignore patterns in config.xml not working - Feature
There seems to be a syncthing feature “Default ignore patterns” which should address that issue about global ignore patterns.
Read more >
Ignoring files by pattern - IBM
You specify additional ignore patterns for an individual project to allow the specification of a set of regular expressions to be ignored by...
Read more >
gitignore Documentation - Git
Patterns which a user wants Git to ignore in all situations (e.g., ... Git does not follow symbolic links when accessing a .gitignore...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found