-
Notifications
You must be signed in to change notification settings - Fork 121
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
Support // sort-imports-ignore #230
Comments
I would like to provide an additional use case for such a rule. I have a singleton configuration object that needs to be imported on the very first line. // This import MUST be placed before any other app code
import './config';
import { registerRootComponent } from 'expo';
import App from './App';
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
registerRootComponent(App); |
Sorry @ayusharma or @byara for the ping, but do you think you'll have a chance to review this PR anytime soon ? #237 I'll be happy to help if you need to chance something. Thanks for your work and your time 🙏 |
I would love to see an ignore rule. The suggested solution, sorting relative first, is absolutely not what I want. |
Look, I was just trying to offer a workaround since the plugin doesn't currently support this use case. Not sure why I got the downvotes. I never said we don't need this. Also, it's not all relative files first, just ones that have the special prefix. Everything else is sorted at the end. |
Resolved at #237 |
No new release yet though... :-/ |
Released in v4.3.0 |
TY! |
TY |
Is your feature request related to a problem?
Yes, I can't ignore this plugin only on certain files.
To ignore import sort, we need to ignore it via
.prettierignore
, therefore ignoring prettifying the whole file.Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
I suggest a simple fixup, similar to other sort imports plugins provide:
https://github.com/simonhaenisch/prettier-plugin-organize-imports/blob/d5ac2f4f2dba549a5a55bf05b3f2f0360e2358e4/index.js#L14
Files containing the substring
// sort-imports-ignore
or// tslint:disable:sort-imports
will be skipped.So files with the
sort imports ignore
comment won't be reordered, e.g.Additional context
A follow-up on: #26 due to the large demand by the community
The text was updated successfully, but these errors were encountered: