Skip to content

Allow changing the Order of ESLint and Prettier being applied #2200

Closed

Description

@KiwiKilian

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.

Activity

  1. mrlubos commented on Jun 18, 2025

    @mrlubos
    Member

    Hey @KiwiKilian, is this something that came up recently? I haven't heard you mention this before

  2. added
    feature 🚀
    on Jun 18, 2025
  3. KiwiKilian commented on Jun 18, 2025

    @KiwiKilian
    Author

    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.

  4. FloEdelmann commented on Jul 14, 2025

    @FloEdelmann
    Contributor

    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).

  5. 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
  6. KiwiKilian commented on Nov 11, 2025

    @KiwiKilian
    Author

    Thanks for picking this up @FloEdelmann! 🙏

  7. mrlubos commented on Jan 11, 2026

    @mrlubos
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature 🚀

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions