-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Organize imports: add an option to put all absolute paths after node_modules ones #30456
Comments
same demand here. |
Any updates? It would be great to have this feature |
Oh yes, the current way makes this feature useless. Absolute paths are so common these days. |
Expected sorting
But with path aliases (depending on the configuration), global project imports will appear first before the node_modules imports. Right now there's no distinction between global node_modules and global project imports. tsconfig.json: {
"baseUrl": "./",
"paths": { "@/*": ["./src/*"], },
} file system:
Home.js expected order: import React from 'react';
import { log } from '@/shared/log';
import Button from './Button'; Instead the result is: import { log } from '@/shared/log';
import React from 'react';
import Button from './Button';
|
@RyanCavanaugh is there any feedback I can help provide? |
same problem here, but i usually use |
Same request here! Has anyone found an equivalent plugin? |
I'm using prettier with this plugin https://github.com/IanVS/prettier-plugin-sort-imports it's pretty good |
Feature Request
Add a configuration option that to sort all the absolute paths (i.e. with
baseUrl = /src
injsconfig.json
) after all the node_modules paths.Reason
More and more people use alias to avoid long relative paths. It's a common practice to have first the third-party imports, then the absolute paths, and finally the relative ones.
The text was updated successfully, but these errors were encountered: