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

lintText does not apply ignores config #168

Closed
marionebl opened this issue Nov 25, 2016 · 1 comment · Fixed by #169
Closed

lintText does not apply ignores config #168

marionebl opened this issue Nov 25, 2016 · 1 comment · Fixed by #169

Comments

@marionebl
Copy link
Contributor

marionebl commented Nov 25, 2016

lintText does not apply the ignores config as opposed to lintFiles.

Given lintText has opts.filename and opts.cwd available we could compute if a given file should be ignored.

Don't know if this is less intuitive, though. What do you think @sindresorhus?


@marionebl marionebl changed the title lintText does not apply ignores config lintText does not apply ignores config Nov 25, 2016
@sindresorhus
Copy link
Member

👍 We could use multimatch, which supports the same patterns as globby, but works on paths instead of the actual filesystem.

marionebl added a commit that referenced this issue Nov 26, 2016
- add multimatch-powered short-circuit to `lintText`
- add supporting test cases
- closes #168
sindresorhus pushed a commit that referenced this issue Dec 13, 2016
* feat: apply `.ignores` to `lintText`

- add multimatch-powered short-circuit to `lintText`
- add supporting test cases
- closes #168

* fix: respect overrides before ignoring files

*  merge applicable overrides before ignoring files
*  throw for opts.ignores without opts.filename
*  use default ignores when opts.filename is given
*  add test case for default ignores

BREAKING CHANGES:
* lintText now uses the same default ignores as lintFiles with opts.filename
  * **/node_modules/**
  * **/bower_components/**
  * coverage/**
  * {tmp,temp}/**
  * **/*.min.js
  * **/bundle.js
  * fixtures{-*,}.{js,jsx}
  * fixture{s,}/**
  * {test,tests,spec,__tests__}/fixture{s,}/**
  * vendor/**
  * dist/**
* lintText now throws when providing opts.ignores without opts.filename

* style: use lodash.isequal, shorten error message

* test: add case with overriden ignores

* chore: remove array-equal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants