-
Notifications
You must be signed in to change notification settings - Fork 30
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
Does not Sort in One Go #26
Comments
I'd happily accept a PR addressing the issue |
@FlorianWendelborn did you start on a PR for fixing this? I'm experiencing the same problem with linting OpenAPI generated type files. |
I have the same problem, is anyone working on it ? |
I’m not working on it as I no longer need this particular solution. It’s still a good improvement though unless it’s already fixed so I’m not closing it |
I had a similar problem with an autogenerated TypeScript file from a GraphQL schema and found a workaround. Running the "scripts": {
"eslint-gql": "bash -c \"until eslint 'types/api/graphql.ts' --fix --cache; do echo \\\"linting again...\\\"; done\""
} Not the most elegant solution, but it'll work for now. Hope it helps! |
I've started working on this. Too much of a pet peeve to introduce to my repo, everyone will hate me if they have to save 5 times 😅 So far I've added a test with |
I think the reason it doesn't sort in one go is due to conflicting fixes, and the nature of reporting each fix as a swap of nodes (docs on conflicting fixes). ESLint will rerun the plugin 10 times but that's not enough for large files. That, and I noticed some error messages like Given all this, the fix I'm working on includes:
It's slow going, but the breadth of test cases already included feel like a good safety net 🙂 |
Hi, |
@adityamatt yep, still planning to create a PR for my changes. The scale is absolutely massive but I'm in the stages of fixing tests to match the new errors |
Just got all of the tests passing. I still want to do some things like testing in supported Node environments and fleshing out test cases, but it's finally come together |
Happy to hear that!! |
hi there :) what is the current status of this issue :) ? What is the recommended solution ? Thank you! |
In very large and nested type definitions, I’ve noticed that this plugin needs up to 5 runs in order to fix all reported sorting issues. First time it finds ~3000, then ~500, then ~50, then 1, then 0.
This wouldn’t be a big deal for manually written code as it rarely changes in significant ways. The file in question is an auto-generated typescript definition file for an entire OpenAPI specification though
The text was updated successfully, but these errors were encountered: