Path: blob/main/docs/rules/no-absolute-path.md
829 views
import/no-absolute-path: Forbid import of modules using absolute paths
Node.js allows the import of modules using an absolute path such as /home/xyz/file.js. That is a bad practice as it ties the code using it to your computer, and therefore makes it unusable in packages distributed on npm for instance.
Rule Details
Fail
Pass
Options
By default, only ES6 imports and CommonJS require calls will have this rule enforced.
You may provide an options object providing true/false for any of
esmodule: defaults totruecommonjs: defaults totrueamd: defaults tofalse
If { amd: true } is provided, dependency paths for AMD-style define and require calls will be resolved: