You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow changing the Order of ESLint and Prettier being applied #2200
We have multiple ESLint rules, which change the line length of the generated code. For example:
@typescript-eslint/consistent-type-definitions for enforcing interface instead of type
arrow-body-style for removing unnecessary return in arrow functions
We also follow Prettier's recommendation, by not enforcing the Prettier rule set through a plugin, but to disable those rules and just let Prettier take care of formatting.
Currently openapi-ts applies first Prettier and afterwards ESLint. Due to ESLint making significant changes, Prettier finds new changes, after ESLint has been applied. At least in our setup, it would make more sense, to apply ESLint first and Prettier afterwards. Either this could be an configuration or could work for everyone? I'm not sure, if there are implications for ESLint config, that enforce the Prettier rules.
I think it just surfaced due to some upgrades in our linting setup, but I think I've seen this behavior before. We seldomly run a script to format everything in our codebase and I never went to down to figure, why this git changes happened.
I just started using openapi-ts, and I noticed the same problem. The command line output makes it seem like both tools are started at the same time, but I guess that can't be what's actually happening, as they would overwrite each other's output then. So probably Prettier is executed first, and ESLint afterwards (introducing new formatting inconsistencies).
changed the title [-]Allow changing the Order of ESLint and Prettier beeing applied[/-][+]Allow changing the Order of ESLint and Prettier being applied[/+]on Sep 10, 2025
This will be fully customizable in v0.90.3 via postProcess array where each tool runs in the specified order. You will be also able to provide custom commands if needed.
Activity
mrlubos commentedon Jun 18, 2025
Hey @KiwiKilian, is this something that came up recently? I haven't heard you mention this before
KiwiKilian commentedon Jun 18, 2025
I think it just surfaced due to some upgrades in our linting setup, but I think I've seen this behavior before. We seldomly run a script to format everything in our codebase and I never went to down to figure, why this git changes happened.
FloEdelmann commentedon Jul 14, 2025
I just started using openapi-ts, and I noticed the same problem. The command line output makes it seem like both tools are started at the same time, but I guess that can't be what's actually happening, as they would overwrite each other's output then. So probably Prettier is executed first, and ESLint afterwards (introducing new formatting inconsistencies).
[-]Allow changing the Order of ESLint and Prettier beeing applied[/-][+]Allow changing the Order of ESLint and Prettier being applied[/+]KiwiKilian commentedon Nov 11, 2025
Thanks for picking this up @FloEdelmann! 🙏
mrlubos commentedon Jan 11, 2026
This will be fully customizable in v0.90.3 via
postProcessarray where each tool runs in the specified order. You will be also able to provide custom commands if needed.FloEdelmann commentedon Jan 11, 2026
For reference:
oxfmtpreset #3197