Open ABaldwinHunter opened 8 years ago
I'm not sure I follow the details, but I always recommend installing CoffeeLint and any plugins as local devDependency
to whatever project you're working on.
@AsaAyers Thanks for the response! It looks like a workaround for our project might be to manually pass a -f
config when calling the coffeelint cli to avoid going through configfinder
.
The issue is that for security reasons, we don't want to install all of a project's plugins. Instead, we'd like to have some node_modules
at hand at location usr/foo/node_modules
preinstalled in the image, but execute the coffeelint analyze
command on a separate project mounted at some directory /bar
in container.
CoffeeLint follows Node's resolution algorithm, which means it will walk up the tree to the root of the drive before giving up.
I think it sounds like you could solve it this way.
docker_root/
└── cccl
├── code
│ ├── coffeelint.json
│ └── other_projects_code.coffee
├── node_modules
│ └── coffee-react-transform
│ └── [ stuff that doesn't matter for this example ]
└── package.json
cccl/package.json
says you need coffee-react-transform
, so it gets installed locally. Then when you mount your code at cccl/code
, if it needs coffee-react-transform
it will be found with the standard resolution algorithm.
I'm working on a tool that runs
coffeelint
in a docker container.It mounts code to lint at
/code
and installsnode_modules
the tool needs atusr/src/app/node_modules
.When we run
coffeelint
from the/code
directory (wherecoffeelint.json
lives), we get the following error loading thecoffee-react-transform
plugin:I traced this error back to the resolve package and the way the configFinder in CoffeeLint expands modules.
Any ideas on a fix for this behavior? I notice that the version of
resolve
is at a little behind, and also that resolve.sync accepts amoduleDirectory
option (default isnode_modules
), but haven't identified a solution.Thanks for any thoughts! :) Cheers