-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is any way for use Webpack alias like internal path? #1306
Comments
Same here 👋 #1294 solved it very specifically for I'd rather not change my aliases because of linting rules, so what do you think is the best approach? Happy to make a PR. |
I’d recommend not using @ not because of linting rules, but because it conflicts with how npm works. The latest version of this plugin supports specifying an order for “unknown”. |
@ljharb fantastic! That works for me. Thanks 👍 |
The sorting work if I use This doesnt trigger an error (but it should): import fr from '@/i18n/fr/plyr.js';
import Plyr from 'plyr'; This trigger and error asking me to put Plyr first (as intended): import fr from '~/i18n/fr/plyr.js';
import Plyr from 'plyr'; |
@mrleblanc101 how do you have the eslint rule configured? |
Yes but it's not changing anything. Maybe my pattern is wrong, I'm not quite sure how this is supposed to work.
|
What happens if you also group |
@ljharb Whether i have or not the 'import/order': [
'error',
{
pathGroups: [
{
pattern: '~/**',
group: 'internal',
},
],
},
], import Plyr from 'plyr';
import fr from '~/i18n/fr/plyr.js'; |
After many trial and error, seems like adding
|
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:
The text was updated successfully, but these errors were encountered: