jhnns / rewire

Easy monkey-patching for node.js unit tests
MIT License
3.08k stars 128 forks source link

move eslint to devDependencies #135

Closed odedniv closed 6 years ago

odedniv commented 6 years ago

Having eslint as a dependencies causes my project to pull eslint to the project's node_modules, which overrides my globally installed eslint.

Since eslint is only required for developing rewire and is not required for rewire to function, it should be moved to devDependencies.

Thanks!

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 97.619% when pulling 09529c8b77450b52e221f69274d353859075345c on odedniv:move-eslint-to-devdep into 6ffd4d1405c9f812f7bcd3b915f4da262afec754 on jhnns:master.

jhnns commented 6 years ago

Sorry, eslint is not a dev dependency in our case. Since we're rewriting const to let, we need to check first that const are not re-assigned.

Why is that a problem for you? If you're using ESLint in your project, wouldn't it make more sense to have it as a dev dependency in your application (assuming you're calling it via npm scripts)?

odedniv commented 6 years ago

I did that eventually, it does make more sense to install eslint locally.

The problem was that I had configured eslint globally, including a plugin that was also installed globally. Because rewire had eslint installed locally my editor and package.json scripts used it instead, and the locally installed eslint wouldn't load the globally installed plugin which made my global configuration invalid (eslint crashed for missing plugin).

Thanks though

DalderupMaurice commented 6 years ago

You can achieve the same with a simple .eslintrc file, instead of having it in your code, right? I have the same issue as @odedniv as I am using babel 7 and eslint v4 is loaded with babel 6