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(export-default): export a type instead of an interface Fixes #71 #74

Merged
merged 2 commits into from
Jul 6, 2020

Conversation

nperez0111
Copy link
Contributor

Rel: #71

Before we were unable to do this:

export interface Styles {
  'classname--first': string;
  'classname--second': string;
}

function foo(bar: Record<string, string>){
	return Object.keys(bar);
}

Because an interface does not allow being cast as a wider type. This fixes that by using types instead of interfaces:

export type Styles = {
  'classname--first': string;
  'classname--second': string;
}

BREAKING CHANGE: this can interfere with how others use their default exported classnames

PS: added some typo fixes in as well

…y#71

Before we were unable to do this:
```typescript
export interface Styles {
  'classname--first': string;
  'classname--second': string;
}
function foo(bar: Record<string, string>){
	return Object.keys(bar);
}
```
Because an interface does not allow being cast as a wider type. This fixes that by using types instead of interfaces:
```typescript
export type Styles = {
  'classname--first': string;
  'classname--second': string;
}
```

BREAKING CHANGE: this can interfere with how others use their default exported classnames
@skovy
Copy link
Owner

skovy commented Jul 5, 2020

@nperez0111 overall this looks great! Thanks for fixing all of the typos as well.

Not sure if this was ready for review or not, but I'll take another look after you have the chance to fix the failing tests 👍

@nperez0111
Copy link
Contributor Author

Thanks for mentioning the tests, are fixed now!

@skovy skovy merged commit 859013d into skovy:master Jul 6, 2020
@skovy
Copy link
Owner

skovy commented Jul 6, 2020

@all-contributors please add @nperez0111 for bug and code

@allcontributors
Copy link
Contributor

@skovy

I've put up a pull request to add @nperez0111! 🎉

@skovy
Copy link
Owner

skovy commented Jul 6, 2020

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@skovy skovy added the released label Jul 6, 2020
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