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

feat: support prettierConfigs with internal default options #592

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yunsii
Copy link
Contributor

@yunsii yunsii commented Aug 25, 2024

Description

prettierConfigs with internal runtime default options makes users customize code format easy with the consistent format style.

For examples:

  • I used to customize formatting SVG with html parser
  • I also want to allow users to format GLOB_SRC with prettier rather than stylistic
  • Others possible code formatting by prettier...

Linked Issues

Additional context

Copy link

netlify bot commented Aug 25, 2024

Deploy Preview for melodious-froyo-4871f8 ready!

Name Link
🔨 Latest commit 14d2607
🔍 Latest deploy log https://app.netlify.com/sites/melodious-froyo-4871f8/deploys/66ca7e6943f9a30008f0bba7
😎 Deploy Preview https://deploy-preview-592--melodious-froyo-4871f8.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

/**
* Custom configs let you have different configuration for certain file extensions and specific files.
*/
prettierConfigs?: (options: PrettierConfigsOptions) => TypedFlatConfigItem[]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about the return of TypedFlatConfigItem[] convention, which supposedly to be the append or prepend operation of the main config. Also it feels a bit too specific here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any suggestions to optimize it?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what you want - for appending the config you and use .append etc, I guess you'd more like to read the resolved options?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope to allow users to use prettier intead of stylistic to format GLOB_SRC, but I can not get the internal runtime prettier options easily to keey the consistent format style.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it will be easily to format others files by prettier if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants