rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

Using absolute paths in require calls

Open janodvarko opened this issue 6 years ago • 0 comments

It would be great to have unified approach to module paths we are passing to require calls. We are currently mixing absolute and relative paths, which doesn't seem ideal.

Examples:

require("devtools/client/shared/vendor/react-prop-types");`
require("../utils/request-utils");

Preferring absolute paths might have positive impact:

  • easy to lint
  • easier refactoring (easier to find consumers of give module)
  • easier to handle ES Modules and import
  • easier search in general

WDYT?

Honza

janodvarko avatar Nov 15 '19 09:11 janodvarko