Support allow option in no-unassigned-import, fix #671#737
Conversation
|
|
||
| This rule supports the following option: | ||
|
|
||
| `allow`: An Array of globs. The files that match any of these patterns would be ignored/allowed by the linter. This can be usefull for some build environment (e.g. css-loader in webpack). |
There was a problem hiding this comment.
s/usefull/useful, s/environment/environments
|
|
||
| function testIsAllow(globs, filename, source) { | ||
| if (!Array.isArray(globs)) { | ||
| return false // default doens't allow any pattern |
There was a problem hiding this comment.
s/doens't/doesn't, s/pattern/patterns
| 'devDependencies': { 'type': ['boolean', 'array'] }, | ||
| 'optionalDependencies': { 'type': ['boolean', 'array'] }, | ||
| 'peerDependencies': { 'type': ['boolean', 'array'] }, | ||
| 'allow': { 'type': 'array' }, |
There was a problem hiding this comment.
should this require that it be an array of strings specifically?
|
Sorry for the typos, will change it next commit! Yes, I think it should. |
|
Hey guys! Are we close to this being resolved? It looks like the only PR conflict is the |
|
@kevin940726 please rebase on the command line so as to avoid merge commits; if you have trouble, i can do it for you. |
|
(also; tests are failing) |
|
My bad, didn't notice that. I'll try my best. 😔 |
|
Is the tests failing on |
|
@kevin940726 sorry for the delay here. I've rebased your branch for you and resolved the conflicts. Tests seem to pass locally, so let's see if this will get them to pass. |
Add
allowoption tono-unassigned-importto fix #671.I basically follow the same logic from
no-extraneous-dependencies. With the glob matching start fromprocess.cwd(). I'm not sure that this is the best solution (maybe use regexp like webpack do?), but it works. Please let me know if there is something need to be improved. Big thanks!