eslint-plugin-require-path-exists icon indicating copy to clipboard operation
eslint-plugin-require-path-exists copied to clipboard

Doesn't work for `require.main.require()`

Open grokky1 opened this issue 7 years ago • 1 comments

I hate crazy long and confusing relative paths like: let customer = require(../../../../foo/bar/baz/customer);

So I use absolute paths instead: let customer = require.main.require(./public/foo/bar/baz/customer);

But that doesn't work. Is this supported?

grokky1 avatar Oct 03 '17 14:10 grokky1

@grokky1 try to use NODE_PATH then you'll be able to let customer = require('public/foo/bar/baz/customer')

titarenko avatar May 22 '18 10:05 titarenko