import-js/eslint-plugin-import

Is any way for use Webpack alias like internal path?

Offen

#1.306 geöffnet am 21.03.2019

 (9 Kommentare) (9 Reaktionen) (0 zugewiesene Personen)JavaScript (1.549 Forks)batch import
help wantedimport/export ordering

Repository-Metriken

Stars
 (5.938 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 138T 22h) (3 gemergte PRs in 30 T)

Beschreibung

https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md

Seems that only paths like 'src/foo' interpretated like internal. But if you use Webpack, you can define some "path alias" (in 90% ways it's like '@/....', or '~/....'. It used in many boilerplates). Is there any ways for use Webpack alias as internal? I found only one solutions:

node_modules/eslint-plugin-import/lib/core/importType.js
// change
const externalModuleRegExp = /^\w/;
// to
const externalModuleRegExp = /^(\w)|(@+\/)|(~+\/)/;

Contributor Guide