-
Notifications
You must be signed in to change notification settings - Fork 55
fix: remove allowSyntheticDefaultImports and allow it on docs #46
Conversation
src/components/Input/Input.tsx
Outdated
@@ -85,15 +85,15 @@ class Input extends UIComponent<any, any> { | |||
const { children, className, icon, input, type } = this.props | |||
const [htmlInputProps, restProps] = this.partitionProps() | |||
|
|||
const inputClasses = cx(classes.input) | |||
const inputClasses = (cx as any)(classes.input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we yarn add --dev @types/classnames
to avoid this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do have it but it still throws
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted the change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I think we can get rid of the as any
for classnames
by adding community typings.
Just for posterity's sake, the reason for the change is to support all consumers (not just Teams 😃). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the CHANGELOG.md in the root of the project.
changelog updated |
allowSyntheticDefaultImports is not allowed on neither of teams-modular-packages/WebClient. This PR will disable it for /src but will allow it on the docs site.
As a result, all import statements from packages with no default import is updated:
e.g.
import React from 'react'
-->import * as React from 'react'
There are a few instances where a 3rd party dependency has an incomplete type def, which are skipped by type assertion:
e.g.
const inputClasses = cx(classes.input)
-->const inputClasses = (cx as any)(classes.input)