File tree Expand file tree Collapse file tree 5 files changed +25
-2
lines changed
babel-plugin-transform-imports Expand file tree Collapse file tree 5 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ function trimIndent(str: string) {
4949 let indent = ''
5050 lines . forEach ( ( line , _i ) => {
5151 // matches whitespace at the end of a string
52- line . replace ( / \s * $ / , '' )
52+ // eslint-disable-next-line no-param-reassign
53+ line = line . replace ( / \s * $ / , '' )
5354 if ( indentFound === false ) {
5455 if ( line === '' ) {
5556 return
Original file line number Diff line number Diff line change @@ -7,16 +7,29 @@ category: packages
77This will convert any non-default imports that are referencing the package only to reference the full path to the module instead. For example:
88
99``` js
10+ -- -
11+ type: code
12+ -- -
1013// a named member import:
1114import { Text } from ' @instructure/ui-elements'
15+ ```
1216
1317would be converted to
1418
19+ ``` js
20+ -- -
21+ type: code
22+ -- -
1523// a named import using the full module path:
1624import { Text } from ' @instructure/ui-elements/lib/Text'
25+ ```
1726
1827Note that any default imports you are currently using will not be transformed:
1928
29+ ``` js
30+ -- -
31+ type: code
32+ -- -
2033// a default import using the full path (will not be transformed):
2134import Text from ' @instructure/ui-elements/lib/Text'
2235```
Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ npm install @instructure/ui-form-field
3030### Usage
3131
3232``` js
33+ -- -
34+ type: code
35+ -- -
3336import React from ' react'
3437import { FormField } from ' @instructure/ui-form-field'
3538
Original file line number Diff line number Diff line change @@ -18,7 +18,10 @@ npm install @instructure/ui-test-locator
1818
1919### Usage
2020
21- ``` javascript
21+ ``` js
22+ -- -
23+ type: code
24+ -- -
2225// MyComponent.js
2326import { testable } from ' @instructure/ui-testable'
2427
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ npm install @instructure/ui-tooltip
2525### Usage
2626
2727``` js
28+ -- -
29+ type: code
30+ -- -
2831import React from ' react'
2932import { Tooltip } from ' @instructure/ui-tooltip'
3033
You can’t perform that action at this time.
0 commit comments