Skip to content
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 configuration defined ignore lists in a similar way as ESLint (loading ignore lists from multiple sources) #15481

Open
Standard8 opened this issue Oct 3, 2023 · 2 comments
Labels
area:cli Issues with Prettier's Command Line Interface type:enhancement A potential new feature to be added, or an improvement to how we print something

Comments

@Standard8
Copy link

The current options for ignoring files are inadequate for complex projects where lists of files to be ignored may be shared across different tools.

As proposed elsewhere in a PR, using ESLint's style of ignorePatterns in the configuration file would fix this issue and provide plenty of flexibility.

Using the same ignorePatterns in Prettier's configuration file would:

  • Allow dynamically loading ignore files from other places.
  • Allow the ignore list to be applied at the command line and in editors.
  • Provide a single place for configuration.

The current options are inadequate because:

  • Using .prettierignore does not allow import from other files.
  • Using multiple --ignore-path arguments on the command line (added in v3), is not practical for editor integration, since different editors would need additional settings.
  • prettierIgnore key in package.json? #3460 / Add support for prettierIgnore key in package.json #12672 are proposing for a prettierIgnore in package.json, however, this is insufficient as:
    • if you also used ESLint, then you'd have an eslintIgnore list as well which would likely largely be a duplicate.
    • you would not be able to load other ignore lists as package.json is a static file.
@Standard8
Copy link
Author

Standard8 commented Oct 3, 2023

Note, I originally attempted this here, but never got any feedback from the questions that I had raised about it.

@sosukesuzuki sosukesuzuki added type:enhancement A potential new feature to be added, or an improvement to how we print something area:cli Issues with Prettier's Command Line Interface labels Oct 4, 2023
@Standard8
Copy link
Author

FTR #14785 seems to be the current proposal to implement this, although #15322 is an alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:cli Issues with Prettier's Command Line Interface type:enhancement A potential new feature to be added, or an improvement to how we print something
Projects
None yet
Development

No branches or pull requests

2 participants