eslint / eslint-transforms

Codemods for the ESLint ecosystem
Other
22 stars 8 forks source link

Fix: use __dirname to find transform files (refs #2) #3

Closed vitorbal closed 8 years ago

vitorbal commented 8 years ago

The executable was not using __dirname to look for the transforms before, which was causing it to error out when installed through npm (See #2). This PR should fix the issue.

nzakas commented 8 years ago

LGTM

nzakas commented 8 years ago

@vitorbal does this fix #2? If so, can you update the commit message to say "fixes #2" instead of "refs #2"?

vitorbal commented 8 years ago

@nzakas the first commit does not fix #2, only part of the problem, that's why I chose to use "refs".

I just pushed a second commit that does indeed fix #2 entirely. It does away with the shelljs-nodecli package in favor of the approach described in your blog post (thanks again for the link!).

The bin should now be able to find jscodeshift if eslint-transforms is installed globally or locally, and also if dependencies are flattened. Let me know if the code makes sense from your perspective!