import-js/eslint-plugin-import

Is any way for use Webpack alias like internal path?

Open

#1,306 opened on Mar 21, 2019

View on GitHub
 (9 comments) (9 reactions) (0 assignees)JavaScript (4,946 stars) (1,540 forks)batch import
help wantedimport/export ordering

Description

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

Is any way for use Webpack alias like internal path? · import-js/eslint-plugin-import#1306 | Good First Issue