Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Ignore Specific Invalid Files #10

Open
CatGuardian opened this issue Dec 23, 2019 · 1 comment
Open

Feature: Ignore Specific Invalid Files #10

CatGuardian opened this issue Dec 23, 2019 · 1 comment

Comments

@CatGuardian
Copy link

I have a feature request.

It would be really nice if there was an options that allowed me to specify a directory or a list of files to be ignored from erroring.

One of the files that is being looked at by depcheck requires sudo to access it. But it is completely irrelevant for gulp-depcheck or depcheck to be looking at it.

So I want to be able to have it not report the error when it gets flagged as an invalid file because the process doesn't have permission to read the file.

Here is a code snippet from gulpDepcheck.js:

        const invalidDirs = ignoreInvalidDirs ? [] : Object.keys(unused.invalidDirs || {}),
              invalidFiles = ignoreInvalidFiles ? [] : Object.keys(unused.invalidFiles || {});

        if (invalidFiles.length > 0) {
          return reject(pluginError(`Unable to parse some files: ${invalidFiles.join(', ')}`));
        }

I don't want it throw Unable to parse some files: ${invalidFiles.join(', ')} when this file that i'm talking about is invalid because I want it to be ignored.

@CatGuardian
Copy link
Author

Wow, I had specified

depcheck({
  ignoreDirs: ['lib', 'test/assets'],
  ignoreMatches: ['@types/*', 'mocha-bamboo-reporter', 'tslib'],
})

And the 'test/assets' directory wasn't being ignored. But I changed it to:

depcheck({
  ignoreDirs: ['lib', 'assets'],
  ignoreMatches: ['@types/*', 'mocha-bamboo-reporter', 'tslib'],
})

And the files in my 'test/assets' were being ignored. This isn't the best... What if I wanted 'src/assets' to be checked by depcheck but I wanted 'test/assets' to not be checked? This isn't good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant