-
Notifications
You must be signed in to change notification settings - Fork 140
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
feat: added support for sort-imports-ignore #237
Conversation
maybe the string to search for ignore could be in the "constants.ts" file |
I actually didn't notice the constants.ts file and i'll add that right the way. Nice catch @d0whc3r |
Would really like this feature to! Thanks @stephdotnet |
@ayusharma could you please review this? Seems to be a popular feature request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me ❤️ @byara can you please check 🙏
Released in v4.3.0 |
@byara I did add
|
Same for me as well, @danielR2001 Did you manage to resolve it? |
@TheMikeyRoss @danielR2001 Make sure |
Thanks @zaaakher that fixed it for me |
Thanks @zaaakher , that fixed for me too! |
This works for me. |
Hey everyone. Is this also supported in {
"endOfLine": "auto",
"importOrder": ["^@/(.*)$", "^[./]"],
"importOrderParserPlugins": ["typescript", "jsx", "decorators-legacy"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"printWidth": 120,
"proseWrap": "always",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
} But EDIT: technically, it's a |
To add to what I wrote above, my "interesting lines" that I don't want to move are for const myMock = jest.fn();
jest.mock('src/dependency/imported/by/MyModule', () => { /* ... */ });
// import other stuff
// import MyModule (jest.mock call would capture the dpendency here)
// My tests Now, when |
Hi,
Thank you for this amazing package. I have been using it on some of my projects. However, recently I needed to ignore the import order for certain specific files.
I encountered this issue: #230 and decided to contribute to the solution.
I chose to follow the basic idea of ignoring the file if a leading comment
// sort-imports-ignore
is detected (as you mentioned in a previous issue, it is tricky to ignore specific lines, and we will probably need an RFC before diving into it: #26).I attempted to follow your approach for parsing and formatting the code, which was very interesting by the way, and added the necessary tests.
Please feel free to ask for more if needed, and I will make the appropriate changes.