Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 75c139d

Browse files
committed
fix(ts): remove esModuleInterop
1 parent 30e5c71 commit 75c139d

File tree

110 files changed

+254
-244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+254
-244
lines changed

.github/CONTRIBUTING.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Stateful components should be classes:
121121
```js
122122
import { AutoControlledComponent as Component } from '../../lib'
123123

124-
class Dropdown extends Component {
124+
class Dropdown extends React.Component {
125125
// ...
126126
}
127127
```
@@ -168,7 +168,8 @@ class MyComponent {
168168
Every component must have fully described `propTypes`.
169169

170170
```js
171-
import React, { PropTypes } from 'react'
171+
import * as React from 'react'
172+
import PropTypes from 'prop-types'
172173

173174
function MyComponent(props) {
174175
return <div className={props.position}>{props.children}</div>
@@ -239,7 +240,7 @@ Each group has an API pattern and prop util for building up the `className` and
239240
Use [`classNameBuilders`][4] to extract the prop values and build up the `className`. Grouped classes like `color` and `size` simply use the prop value as the `className`.
240241

241242
```js
242-
import cx from 'classnames'
243+
import * as cx from 'classnames'
243244
import { useKeyOnly, useValueAndKey, useKeyOrValueAndKey } from '../../lib'
244245

245246
function Segment({ size, color, basic, floated, padded }) {
@@ -412,7 +413,7 @@ common.propKeyOrValueAndKeyToClassName()
412413
Every common test receives your component as its first argument.
413414

414415
```js
415-
import React from 'react'
416+
import * as React from 'react'
416417
import * as common from 'test/specs/commonTests'
417418
import Menu from 'src/collections/Menu/Menu'
418419
import MenuItem from 'src/collections/Menu/MenuItem'
@@ -483,7 +484,7 @@ function MyComponent(props) {
483484
If you're component requires event handlers, it is a stateful class component. Want to know [why][15]?
484485

485486
```js
486-
class MyComponent extends Component {
487+
class MyComponent extends React.Component {
487488
handleClick = (e) => {
488489
console.log('Clicked my component!')
489490
}

build/gulp/plugins/gulp-component-menu.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import gutil from 'gulp-util'
2-
import path from 'path'
3-
import through2 from 'through2'
4-
import Vinyl from 'vinyl'
1+
import * as gutil from 'gulp-util'
2+
import * as path from 'path'
3+
import * as through2 from 'through2'
4+
import * as Vinyl from 'vinyl'
55

66
import getComponentInfo from './util/getComponentInfo'
77

build/gulp/plugins/gulp-example-menu.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import gutil from 'gulp-util'
2-
import _ from 'lodash'
3-
import path from 'path'
4-
import through2 from 'through2'
5-
import Vinyl from 'vinyl'
1+
import * as gutil from 'gulp-util'
2+
import * as _ from 'lodash'
3+
import * as path from 'path'
4+
import * as through2 from 'through2'
5+
import * as Vinyl from 'vinyl'
66

77
import { parseDocSection } from './util'
88

build/gulp/plugins/gulp-react-docgen.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import gutil from 'gulp-util'
2-
import path from 'path'
3-
import through2 from 'through2'
4-
import Vinyl from 'vinyl'
1+
import * as gutil from 'gulp-util'
2+
import * as path from 'path'
3+
import * as through2 from 'through2'
4+
import * as Vinyl from 'vinyl'
55

66
import { getComponentInfo } from './util'
77

build/gulp/plugins/util/getComponentInfo.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import _ from 'lodash'
2-
import path from 'path'
1+
import * as _ from 'lodash'
2+
import * as path from 'path'
33
import { defaultHandlers, parse, resolver } from 'react-docgen'
4-
import fs from 'fs'
5-
import ts from 'typescript'
4+
import * as fs from 'fs'
5+
import * as ts from 'typescript'
66
import parseDefaultValue from './parseDefaultValue'
77
import parseDocblock from './parseDocblock'
88
import parserCustomHandler from './parserCustomHandler'

build/gulp/plugins/util/isUIComponentClass.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { utils } from 'react-docgen'
2-
import recast from 'recast'
2+
import * as recast from 'recast'
33

44
const { match, resolveToValue } = utils
55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import _ from 'lodash'
1+
import * as _ from 'lodash'
22

33
export default propDef => _.get(propDef, 'defaultValue.value', undefined)

build/gulp/plugins/util/parseDocSection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import _ from 'lodash'
1+
import * as _ from 'lodash'
22
import traverse from 'babel-traverse'
33

44
import parseBuffer from './parseBuffer'

build/gulp/plugins/util/parseDocblock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import doctrine from 'doctrine'
1+
import * as doctrine from 'doctrine'
22

33
export default docblock => {
44
const { description = '', tags = [], ...rest } = doctrine.parse(docblock || '', { unwrap: true })

build/gulp/plugins/util/parserCustomHandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import _ from 'lodash'
2-
import { types } from 'recast'
1+
import * as _ from 'lodash'
2+
import * as recast from 'recast'
33
import { utils } from 'react-docgen'
44

5-
const { namedTypes } = types
5+
const { namedTypes } = recast.types
66
const { getMemberValuePath, getPropertyName, resolveToValue } = utils
77

88
const getObjectName = path => `${_.get(path, 'object.name')}.${_.get(path, 'property.name')}`

0 commit comments

Comments
 (0)