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: export plugin config types #173

Merged
merged 4 commits into from
Oct 20, 2022

Conversation

leomotors
Copy link
Contributor

I would want to export the plugin's config type so user can also type their prettier config, they will look something like this.

// @ts-check

/** @type {import("@trivago/prettier-plugin-sort-imports").PrettierConfig} */
const config = {
    bracketSpacing: true,
    tabWidth: 4,
    useTabs: false,
    singleQuote: false,
    semi: true,
    printWidth: 80,
    plugins: ["@trivago/prettier-plugin-sort-imports"],
    importOrderCaseInsensitive: true,
    importOrderSeparation: true,
    importOrderSortSpecifiers: true,
    importOrderParserPlugins: ["typescript", "decorators-legacy", "jsx"],
};

module.exports = config;

This will help strongly type all parts of their apps, increasing code quality. Please consider this PR 🙏

If you have any concerns like convention, naming, feel free to request changes.

@byara byara requested review from byara and ayusharma October 14, 2022 09:20
Copy link
Collaborator

@byara byara left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution 🚀
I left a comment, but in general looks very good 👍

@leomotors leomotors requested review from byara and removed request for ayusharma October 14, 2022 14:59
Copy link
Collaborator

@byara byara left a comment

Choose a reason for hiding this comment

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

Thanks for the PR 🎉

@byara byara requested a review from ayusharma October 20, 2022 10:05
Copy link
Collaborator

@ayusharma ayusharma left a comment

Choose a reason for hiding this comment

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

Looks good to me. 🚀 Thank you so much for the contribution.

@ayusharma ayusharma merged commit b71b8b4 into trivago:master Oct 20, 2022
IanVS added a commit to IanVS/prettier-plugin-sort-imports that referenced this pull request Oct 26, 2022
Ported from trivago/prettier-plugin-sort-imports#173 & trivago/prettier-plugin-sort-imports#180

We'll likely be deprecating many of these options in the future, but for now, we may as well expose their types and give them some nice docs.

Co-authored-by: Nutthapat Pongtanyavichai <[email protected]>
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.

3 participants