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

fix(types): style/lang types should use declare const #314

Merged
merged 1 commit into from
Dec 28, 2023
Merged

Conversation

metonym
Copy link
Owner

@metonym metonym commented Dec 28, 2023

There's a subtle but important difference between export const and export declare const when used in a type definition file.

  • export const both declares and exports a constant.
  • export declare const signifies types for a variable that is created elsewhere.

declare should be used in this case, since it's a type definition file; the variable is exported elsewhere.

@metonym metonym merged commit bd956d6 into master Dec 28, 2023
1 check passed
@metonym metonym deleted the declare-const branch December 28, 2023 17:16
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.

1 participant