js-dxtools / webpack-validator

Validates your webpack config with Joi
MIT License
295 stars 29 forks source link

Strict mode - Disallow `resolve.root` #77

Closed bebraw closed 8 years ago

bebraw commented 8 years ago

Even though resolve.root can make for short imports, it can also cause strange issues due to aliasing. If you happen to have a directory matching to a npm dependency name, you might end up picking up the directory over the npm dependency. This can be hard to debug. This should yield a warning at least.

jonathanglasmeyer commented 8 years ago

:) we use this extensively at my job and it's quite essential. Your point is of course valid. I'm not sure that I'd like to lint against this, as the benefits are huge. :)

kentcdodds commented 8 years ago

I think it'd be great to warn against using an alias that matches a dependency name though!

bebraw commented 8 years ago

I think it'd be great to warn against using an alias that matches a dependency name though!

That would be enough I think. Disallowing whole field would be too much. This would solve the problem.

jonathanglasmeyer commented 8 years ago

So let's maybe close this and reopen as "Warn for aliases that match a dependency name"?

bebraw commented 8 years ago

Done.