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: add declaration file #280

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

Conversation

zanminkian
Copy link

No description provided.

index.d.ts Outdated
@@ -0,0 +1 @@
export const rules: Record<string, 0 | "off">;
Copy link
Member

Choose a reason for hiding this comment

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

I believe this would be the correct TypeScript declaration:

export = {
  rules: Record<string, 0 | "off">
}

Copy link
Author

@zanminkian zanminkian Feb 22, 2024

Choose a reason for hiding this comment

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

I copied from @types/eslint-config-prettier. Maybe you are right.

Copy link
Member

Choose a reason for hiding this comment

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

So if there is alreay @types/eslint-config-prettier, what the benefit to maintain it here?

Copy link
Author

Choose a reason for hiding this comment

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

@JounQin Therea are many eslint config packages published to npm. eslint-config-prettier builtin support declaration file will be convenient for other packages so that they don't neeed to install both eslint-config-prettier and @types/eslint-config-prettier

Copy link
Contributor

Choose a reason for hiding this comment

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

So if there is alreay @types/eslint-config-prettier, what the benefit to maintain it here?

I'll echo zanminkian's comments here. It is really nice for have the types be included in the main package, as it avoids having to depend on two separate packages. Especially now that the year is 2024, TypeScript has spread across the ecosystem, and this is something that a lot of users will expect out of the box. And it is a pretty low maintenance cost for you!

Would love for this PR to be merged, as I was just avoid to start a new PR to this project for the exact same thing, and was surprised to see one already.

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.

4 participants