@atlaskit/code 15.1.2 → 15.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +444 -183
  2. package/__perf__/source-code-examples/100-line-example.tsx +49 -40
  3. package/codemods/13.0.0-remove-unnecessary-code-props.tsx +61 -75
  4. package/codemods/13.0.0-rename-imports.tsx +214 -251
  5. package/codemods/14.0.0-lite-mode.tsx +5 -9
  6. package/codemods/__tests__/13.0.0-remove-unnecessary-code-props.tsx +43 -43
  7. package/codemods/__tests__/13.0.0-rename-imports.tsx +143 -143
  8. package/codemods/__tests__/14.0.0-lite-mode/14.0.0-lite-mode.tsx +35 -35
  9. package/codemods/__tests__/14.0.0-lite-mode/remove-language.tsx +21 -21
  10. package/codemods/__tests__/14.0.0-lite-mode/text-to-child.tsx +35 -35
  11. package/codemods/migrations/14.0.0-lite-mode/remove-language.tsx +1 -6
  12. package/codemods/migrations/14.0.0-lite-mode/text-to-child.tsx +53 -61
  13. package/codemods/utils/helpers.tsx +161 -201
  14. package/dist/cjs/internal/theme/styles.js +2 -1
  15. package/dist/es2019/internal/theme/styles.js +2 -1
  16. package/dist/esm/internal/theme/styles.js +2 -1
  17. package/dist/types/bidi-warning/ui/index.d.ts +1 -1
  18. package/dist/types/bidi-warning/ui/styled.d.ts +1 -1
  19. package/dist/types/extract-react-types/code-block.d.ts +16 -16
  20. package/dist/types/internal/hooks/use-highlight.d.ts +1 -1
  21. package/dist/types/internal/utils/get-normalized-language.d.ts +1 -1
  22. package/dist/types/syntax-highlighter/async.d.ts +1 -1
  23. package/dist/types/syntax-highlighter/lib/highlight.d.ts +1 -1
  24. package/dist/types/syntax-highlighter/lib/process/create-line-element.d.ts +1 -1
  25. package/dist/types/syntax-highlighter/lib/process/create-line.d.ts +1 -1
  26. package/dist/types/syntax-highlighter/lib/process/flatten-code-tree.d.ts +1 -1
  27. package/dist/types/syntax-highlighter/lib/process/get-code-tree.d.ts +1 -1
  28. package/dist/types/syntax-highlighter/lib/process/get-inline-line-number.d.ts +1 -1
  29. package/dist/types/syntax-highlighter/lib/process/index.d.ts +1 -1
  30. package/dist/types/syntax-highlighter/lib/react-renderer/create-children.d.ts +2 -2
  31. package/dist/types/syntax-highlighter/lib/react-renderer/create-element.d.ts +2 -2
  32. package/dist/types/syntax-highlighter/lib/react-renderer/index.d.ts +1 -1
  33. package/dist/types/syntax-highlighter/types.d.ts +2 -2
  34. package/dist/types/types.d.ts +1 -1
  35. package/dist/types-ts4.5/bidi-warning/ui/index.d.ts +1 -1
  36. package/dist/types-ts4.5/bidi-warning/ui/styled.d.ts +1 -1
  37. package/dist/types-ts4.5/extract-react-types/code-block.d.ts +16 -16
  38. package/dist/types-ts4.5/internal/hooks/use-highlight.d.ts +1 -1
  39. package/dist/types-ts4.5/internal/utils/get-normalized-language.d.ts +1 -1
  40. package/dist/types-ts4.5/syntax-highlighter/async.d.ts +1 -1
  41. package/dist/types-ts4.5/syntax-highlighter/lib/highlight.d.ts +1 -1
  42. package/dist/types-ts4.5/syntax-highlighter/lib/process/create-line-element.d.ts +1 -1
  43. package/dist/types-ts4.5/syntax-highlighter/lib/process/create-line.d.ts +1 -1
  44. package/dist/types-ts4.5/syntax-highlighter/lib/process/flatten-code-tree.d.ts +1 -1
  45. package/dist/types-ts4.5/syntax-highlighter/lib/process/get-code-tree.d.ts +1 -1
  46. package/dist/types-ts4.5/syntax-highlighter/lib/process/get-inline-line-number.d.ts +1 -1
  47. package/dist/types-ts4.5/syntax-highlighter/lib/process/index.d.ts +1 -1
  48. package/dist/types-ts4.5/syntax-highlighter/lib/react-renderer/create-children.d.ts +2 -2
  49. package/dist/types-ts4.5/syntax-highlighter/lib/react-renderer/create-element.d.ts +2 -2
  50. package/dist/types-ts4.5/syntax-highlighter/lib/react-renderer/index.d.ts +1 -1
  51. package/dist/types-ts4.5/syntax-highlighter/types.d.ts +2 -2
  52. package/dist/types-ts4.5/types.d.ts +1 -1
  53. package/package.json +11 -11
  54. package/report.api.md +807 -807
@@ -1,285 +1,248 @@
1
1
  import {
2
- API,
3
- ASTPath,
4
- FileInfo,
5
- Identifier,
6
- ImportSpecifier,
7
- JSCodeshift,
8
- Options,
2
+ type API,
3
+ type ASTPath,
4
+ type FileInfo,
5
+ type Identifier,
6
+ type ImportSpecifier,
7
+ type JSCodeshift,
8
+ type Options,
9
9
  } from 'jscodeshift';
10
- import { Collection } from 'jscodeshift/src/Collection';
10
+ import { type Collection } from 'jscodeshift/src/Collection';
11
11
 
12
12
  import {
13
- getDynamicImportCollection,
14
- getImportDeclarationCollection,
15
- getImportSpecifierCollection,
16
- getImportSpecifierName,
17
- hasDynamicImport,
18
- hasImportDeclaration,
19
- isClassDeclarationIdentifierPresent,
20
- isFunctionDeclarationIdentifierPresent,
21
- isImportDeclarationIdentifierPresent,
22
- isVariableDeclaratorIdentifierPresent,
13
+ getDynamicImportCollection,
14
+ getImportDeclarationCollection,
15
+ getImportSpecifierCollection,
16
+ getImportSpecifierName,
17
+ hasDynamicImport,
18
+ hasImportDeclaration,
19
+ isClassDeclarationIdentifierPresent,
20
+ isFunctionDeclarationIdentifierPresent,
21
+ isImportDeclarationIdentifierPresent,
22
+ isVariableDeclaratorIdentifierPresent,
23
23
  } from './utils/helpers';
24
24
 
25
25
  const importPath = '@atlaskit/code';
26
26
  const importsMapping = {
27
- oldImports: {
28
- Code: 'AkCode',
29
- CodeBlock: 'AkCodeBlock',
30
- },
31
- newImports: {
32
- Code: 'Code',
33
- CodeBlock: 'CodeBlock',
34
- },
27
+ oldImports: {
28
+ Code: 'AkCode',
29
+ CodeBlock: 'AkCodeBlock',
30
+ },
31
+ newImports: {
32
+ Code: 'Code',
33
+ CodeBlock: 'CodeBlock',
34
+ },
35
35
  };
36
36
 
37
37
  function renameNamedImports(
38
- j: JSCodeshift,
39
- collection: Collection<any>,
40
- {
41
- fromImportName,
42
- toImportName,
43
- }: {
44
- fromImportName: string;
45
- toImportName: string;
46
- },
38
+ j: JSCodeshift,
39
+ collection: Collection<any>,
40
+ {
41
+ fromImportName,
42
+ toImportName,
43
+ }: {
44
+ fromImportName: string;
45
+ toImportName: string;
46
+ },
47
47
  ) {
48
- const importDeclarationCollection = getImportDeclarationCollection(
49
- j,
50
- collection,
51
- importPath,
52
- );
53
- const importSpecifierCollection = getImportSpecifierCollection(
54
- j,
55
- importDeclarationCollection,
56
- fromImportName,
57
- );
58
- const importSpecifierName = getImportSpecifierName(importSpecifierCollection);
59
-
60
- if (importSpecifierName === null) {
61
- return;
62
- }
63
-
64
- importSpecifierCollection.forEach((importSpecifierPath) => {
65
- renameBasedOnImportAlias(
66
- j,
67
- collection,
68
- importSpecifierPath,
69
- importSpecifierName,
70
- {
71
- fromImportName,
72
- toImportName,
73
- },
74
- );
75
- });
48
+ const importDeclarationCollection = getImportDeclarationCollection(j, collection, importPath);
49
+ const importSpecifierCollection = getImportSpecifierCollection(
50
+ j,
51
+ importDeclarationCollection,
52
+ fromImportName,
53
+ );
54
+ const importSpecifierName = getImportSpecifierName(importSpecifierCollection);
55
+
56
+ if (importSpecifierName === null) {
57
+ return;
58
+ }
59
+
60
+ importSpecifierCollection.forEach((importSpecifierPath) => {
61
+ renameBasedOnImportAlias(j, collection, importSpecifierPath, importSpecifierName, {
62
+ fromImportName,
63
+ toImportName,
64
+ });
65
+ });
76
66
  }
77
67
 
78
68
  function renameBasedOnImportAlias(
79
- j: JSCodeshift,
80
- collection: Collection<any>,
81
- importSpecifierPath: ASTPath<ImportSpecifier>,
82
- importSpecifierName: string,
83
- {
84
- fromImportName,
85
- toImportName,
86
- }: {
87
- fromImportName: string;
88
- toImportName: string;
89
- },
69
+ j: JSCodeshift,
70
+ collection: Collection<any>,
71
+ importSpecifierPath: ASTPath<ImportSpecifier>,
72
+ importSpecifierName: string,
73
+ {
74
+ fromImportName,
75
+ toImportName,
76
+ }: {
77
+ fromImportName: string;
78
+ toImportName: string;
79
+ },
90
80
  ) {
91
- const isImportAliasPresent = importSpecifierName !== fromImportName;
92
-
93
- if (isImportAliasPresent) {
94
- return renameOnlyImportName(j, importSpecifierPath, importSpecifierName, {
95
- toImportName,
96
- });
97
- }
98
-
99
- const isToImportNameIdentifierPresentInSourceCode =
100
- isVariableDeclaratorIdentifierPresent(j, collection, toImportName) ||
101
- isFunctionDeclarationIdentifierPresent(j, collection, toImportName) ||
102
- isClassDeclarationIdentifierPresent(j, collection, toImportName) ||
103
- isImportDeclarationIdentifierPresent(j, collection, toImportName);
104
-
105
- if (isToImportNameIdentifierPresentInSourceCode) {
106
- return renameOnlyImportNameWithAliasAddition(j, importSpecifierPath, {
107
- fromImportName,
108
- toImportName,
109
- });
110
- }
111
-
112
- return renameImportNameWithItsUsage(j, collection, importSpecifierPath, {
113
- fromImportName,
114
- toImportName,
115
- });
81
+ const isImportAliasPresent = importSpecifierName !== fromImportName;
82
+
83
+ if (isImportAliasPresent) {
84
+ return renameOnlyImportName(j, importSpecifierPath, importSpecifierName, {
85
+ toImportName,
86
+ });
87
+ }
88
+
89
+ const isToImportNameIdentifierPresentInSourceCode =
90
+ isVariableDeclaratorIdentifierPresent(j, collection, toImportName) ||
91
+ isFunctionDeclarationIdentifierPresent(j, collection, toImportName) ||
92
+ isClassDeclarationIdentifierPresent(j, collection, toImportName) ||
93
+ isImportDeclarationIdentifierPresent(j, collection, toImportName);
94
+
95
+ if (isToImportNameIdentifierPresentInSourceCode) {
96
+ return renameOnlyImportNameWithAliasAddition(j, importSpecifierPath, {
97
+ fromImportName,
98
+ toImportName,
99
+ });
100
+ }
101
+
102
+ return renameImportNameWithItsUsage(j, collection, importSpecifierPath, {
103
+ fromImportName,
104
+ toImportName,
105
+ });
116
106
  }
117
107
 
118
108
  function renameOnlyImportName(
119
- j: JSCodeshift,
120
- importSpecifierPath: ASTPath<ImportSpecifier>,
121
- importSpecifierName: string,
122
- {
123
- toImportName,
124
- }: {
125
- toImportName: string;
126
- },
109
+ j: JSCodeshift,
110
+ importSpecifierPath: ASTPath<ImportSpecifier>,
111
+ importSpecifierName: string,
112
+ {
113
+ toImportName,
114
+ }: {
115
+ toImportName: string;
116
+ },
127
117
  ) {
128
- j(importSpecifierPath).replaceWith(
129
- j.importSpecifier(
130
- j.identifier(toImportName),
131
- j.identifier(importSpecifierName),
132
- ),
133
- );
118
+ j(importSpecifierPath).replaceWith(
119
+ j.importSpecifier(j.identifier(toImportName), j.identifier(importSpecifierName)),
120
+ );
134
121
  }
135
122
 
136
123
  function renameOnlyImportNameWithAliasAddition(
137
- j: JSCodeshift,
138
- importSpecifierPath: ASTPath<ImportSpecifier>,
139
- {
140
- fromImportName,
141
- toImportName,
142
- }: {
143
- fromImportName: string;
144
- toImportName: string;
145
- },
124
+ j: JSCodeshift,
125
+ importSpecifierPath: ASTPath<ImportSpecifier>,
126
+ {
127
+ fromImportName,
128
+ toImportName,
129
+ }: {
130
+ fromImportName: string;
131
+ toImportName: string;
132
+ },
146
133
  ) {
147
- j(importSpecifierPath).replaceWith(
148
- j.importSpecifier(j.identifier(toImportName), j.identifier(fromImportName)),
149
- );
134
+ j(importSpecifierPath).replaceWith(
135
+ j.importSpecifier(j.identifier(toImportName), j.identifier(fromImportName)),
136
+ );
150
137
  }
151
138
 
152
139
  function renameImportNameWithItsUsage(
153
- j: JSCodeshift,
154
- collection: Collection<any>,
155
- importSpecifierPath: ASTPath<ImportSpecifier>,
156
- {
157
- fromImportName,
158
- toImportName,
159
- }: {
160
- fromImportName: string;
161
- toImportName: string;
162
- },
140
+ j: JSCodeshift,
141
+ collection: Collection<any>,
142
+ importSpecifierPath: ASTPath<ImportSpecifier>,
143
+ {
144
+ fromImportName,
145
+ toImportName,
146
+ }: {
147
+ fromImportName: string;
148
+ toImportName: string;
149
+ },
163
150
  ) {
164
- j(importSpecifierPath).replaceWith(
165
- j.importSpecifier(j.identifier(toImportName), j.identifier(toImportName)),
166
- );
167
-
168
- collection
169
- .find(j.JSXIdentifier)
170
- .filter(
171
- (jsxIdentifierPath) => jsxIdentifierPath.node.name === fromImportName,
172
- )
173
- .forEach((jsxIdentifierPath) => {
174
- j(jsxIdentifierPath).replaceWith(j.identifier(toImportName));
175
- });
176
-
177
- collection.find(j.CallExpression).forEach((callExpressionPath) => {
178
- const { arguments: callExpressionArguments } = callExpressionPath.node;
179
-
180
- callExpressionPath.node.arguments = callExpressionArguments.map(
181
- (argument) => {
182
- if (
183
- argument.type === 'Identifier' &&
184
- argument.name === fromImportName
185
- ) {
186
- return j.identifier(toImportName);
187
- }
188
-
189
- return argument;
190
- },
191
- );
192
- });
193
-
194
- collection.find(j.VariableDeclarator).forEach((variableDeclaratorPath) => {
195
- const { init } = variableDeclaratorPath.node;
196
-
197
- if (
198
- init &&
199
- init.type === 'Identifier' &&
200
- (init as Identifier).name === fromImportName
201
- ) {
202
- variableDeclaratorPath.node.init = j.identifier(toImportName);
203
- }
204
- });
151
+ j(importSpecifierPath).replaceWith(
152
+ j.importSpecifier(j.identifier(toImportName), j.identifier(toImportName)),
153
+ );
154
+
155
+ collection
156
+ .find(j.JSXIdentifier)
157
+ .filter((jsxIdentifierPath) => jsxIdentifierPath.node.name === fromImportName)
158
+ .forEach((jsxIdentifierPath) => {
159
+ j(jsxIdentifierPath).replaceWith(j.identifier(toImportName));
160
+ });
161
+
162
+ collection.find(j.CallExpression).forEach((callExpressionPath) => {
163
+ const { arguments: callExpressionArguments } = callExpressionPath.node;
164
+
165
+ callExpressionPath.node.arguments = callExpressionArguments.map((argument) => {
166
+ if (argument.type === 'Identifier' && argument.name === fromImportName) {
167
+ return j.identifier(toImportName);
168
+ }
169
+
170
+ return argument;
171
+ });
172
+ });
173
+
174
+ collection.find(j.VariableDeclarator).forEach((variableDeclaratorPath) => {
175
+ const { init } = variableDeclaratorPath.node;
176
+
177
+ if (init && init.type === 'Identifier' && (init as Identifier).name === fromImportName) {
178
+ variableDeclaratorPath.node.init = j.identifier(toImportName);
179
+ }
180
+ });
205
181
  }
206
182
 
207
183
  function addPromiseThenIdentifier(j: JSCodeshift, collection: Collection<any>) {
208
- const thenArgument = 'module';
209
-
210
- getDynamicImportCollection(j, collection, importPath).forEach(
211
- (callExpressionPath) => {
212
- j(callExpressionPath).replaceWith(
213
- j.callExpression(
214
- j.memberExpression(callExpressionPath.node, j.identifier('then')),
215
- [
216
- j.arrowFunctionExpression(
217
- [j.identifier(thenArgument)],
218
- j.objectExpression([
219
- j.objectProperty(
220
- j.identifier(importsMapping.oldImports.Code),
221
- j.memberExpression(
222
- j.identifier(thenArgument),
223
- j.identifier(importsMapping.newImports.Code),
224
- ),
225
- ),
226
- j.objectProperty(
227
- j.identifier(importsMapping.oldImports.CodeBlock),
228
- j.memberExpression(
229
- j.identifier(thenArgument),
230
- j.identifier(importsMapping.newImports.CodeBlock),
231
- ),
232
- ),
233
- ]),
234
- ),
235
- ],
236
- ),
237
- );
238
- },
239
- );
184
+ const thenArgument = 'module';
185
+
186
+ getDynamicImportCollection(j, collection, importPath).forEach((callExpressionPath) => {
187
+ j(callExpressionPath).replaceWith(
188
+ j.callExpression(j.memberExpression(callExpressionPath.node, j.identifier('then')), [
189
+ j.arrowFunctionExpression(
190
+ [j.identifier(thenArgument)],
191
+ j.objectExpression([
192
+ j.objectProperty(
193
+ j.identifier(importsMapping.oldImports.Code),
194
+ j.memberExpression(
195
+ j.identifier(thenArgument),
196
+ j.identifier(importsMapping.newImports.Code),
197
+ ),
198
+ ),
199
+ j.objectProperty(
200
+ j.identifier(importsMapping.oldImports.CodeBlock),
201
+ j.memberExpression(
202
+ j.identifier(thenArgument),
203
+ j.identifier(importsMapping.newImports.CodeBlock),
204
+ ),
205
+ ),
206
+ ]),
207
+ ),
208
+ ]),
209
+ );
210
+ });
240
211
  }
241
212
 
242
- export default function transformer(
243
- fileInfo: FileInfo,
244
- { jscodeshift: j }: API,
245
- options: Options,
246
- ) {
247
- const { source } = fileInfo;
248
- const collection = j(source);
249
-
250
- const hasCodeImportDeclaration = hasImportDeclaration(
251
- j,
252
- collection,
253
- importPath,
254
- );
255
-
256
- const hasDynamicImportCode = hasDynamicImport(j, collection, importPath);
257
-
258
- if (!hasCodeImportDeclaration && !hasDynamicImportCode) {
259
- return source;
260
- }
261
-
262
- if (hasCodeImportDeclaration) {
263
- [
264
- {
265
- fromImportName: importsMapping.oldImports.Code,
266
- toImportName: importsMapping.newImports.Code,
267
- },
268
- {
269
- fromImportName: importsMapping.oldImports.CodeBlock,
270
- toImportName: importsMapping.newImports.CodeBlock,
271
- },
272
- ].forEach(({ fromImportName, toImportName }) => {
273
- renameNamedImports(j, collection, {
274
- fromImportName,
275
- toImportName,
276
- });
277
- });
278
- }
279
-
280
- if (hasDynamicImportCode) {
281
- addPromiseThenIdentifier(j, collection);
282
- }
283
-
284
- return collection.toSource(options.printOptions || { quote: 'single' });
213
+ export default function transformer(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) {
214
+ const { source } = fileInfo;
215
+ const collection = j(source);
216
+
217
+ const hasCodeImportDeclaration = hasImportDeclaration(j, collection, importPath);
218
+
219
+ const hasDynamicImportCode = hasDynamicImport(j, collection, importPath);
220
+
221
+ if (!hasCodeImportDeclaration && !hasDynamicImportCode) {
222
+ return source;
223
+ }
224
+
225
+ if (hasCodeImportDeclaration) {
226
+ [
227
+ {
228
+ fromImportName: importsMapping.oldImports.Code,
229
+ toImportName: importsMapping.newImports.Code,
230
+ },
231
+ {
232
+ fromImportName: importsMapping.oldImports.CodeBlock,
233
+ toImportName: importsMapping.newImports.CodeBlock,
234
+ },
235
+ ].forEach(({ fromImportName, toImportName }) => {
236
+ renameNamedImports(j, collection, {
237
+ fromImportName,
238
+ toImportName,
239
+ });
240
+ });
241
+ }
242
+
243
+ if (hasDynamicImportCode) {
244
+ addPromiseThenIdentifier(j, collection);
245
+ }
246
+
247
+ return collection.toSource(options.printOptions || { quote: 'single' });
285
248
  }
@@ -1,18 +1,14 @@
1
- import { JSCodeshift } from 'jscodeshift';
2
- import { Collection } from 'jscodeshift/src/Collection';
1
+ import { type JSCodeshift } from 'jscodeshift';
2
+ import { type Collection } from 'jscodeshift/src/Collection';
3
3
 
4
- import {
5
- createTransformer,
6
- hasImportDeclaration,
7
- } from '@atlaskit/codemod-utils';
4
+ import { createTransformer, hasImportDeclaration } from '@atlaskit/codemod-utils';
8
5
 
9
6
  import removeLanguage from './migrations/14.0.0-lite-mode/remove-language';
10
7
  import textToChild from './migrations/14.0.0-lite-mode/text-to-child';
11
8
 
12
9
  const transformer = createTransformer(
13
- [removeLanguage, textToChild],
14
- (j: JSCodeshift, source: Collection<Node>) =>
15
- hasImportDeclaration(j, source, '@atlaskit/code'),
10
+ [removeLanguage, textToChild],
11
+ (j: JSCodeshift, source: Collection<Node>) => hasImportDeclaration(j, source, '@atlaskit/code'),
16
12
  );
17
13
 
18
14
  export default transformer;
@@ -5,24 +5,24 @@ import transformer from '../13.0.0-remove-unnecessary-code-props';
5
5
  const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
6
6
 
7
7
  const removePropsMapping = {
8
- lineNumberContainerStyle: 'lineNumberContainerStyle',
9
- showLineNumbers: 'lineNumberContainerStyle',
10
- highlight: 'highlight',
8
+ lineNumberContainerStyle: 'lineNumberContainerStyle',
9
+ showLineNumbers: 'lineNumberContainerStyle',
10
+ highlight: 'highlight',
11
11
  };
12
12
 
13
13
  describe('Remove props', () => {
14
- defineInlineTest(
15
- { default: transformer, parser: 'tsx' },
16
- {},
17
- `import React from 'react';`,
18
- `import React from 'react';`,
19
- 'should not transform if imports are not present',
20
- );
21
-
22
- defineInlineTest(
23
- { default: transformer, parser: 'tsx' },
24
- {},
25
- `
14
+ defineInlineTest(
15
+ { default: transformer, parser: 'tsx' },
16
+ {},
17
+ `import React from 'react';`,
18
+ `import React from 'react';`,
19
+ 'should not transform if imports are not present',
20
+ );
21
+
22
+ defineInlineTest(
23
+ { default: transformer, parser: 'tsx' },
24
+ {},
25
+ `
26
26
  import React from 'react';
27
27
  import { Code } from '@atlaskit/code';
28
28
 
@@ -34,7 +34,7 @@ describe('Remove props', () => {
34
34
 
35
35
  const element = <Code prop="abc" />;
36
36
  `,
37
- `
37
+ `
38
38
  import React from 'react';
39
39
  import { Code } from '@atlaskit/code';
40
40
 
@@ -46,14 +46,14 @@ describe('Remove props', () => {
46
46
 
47
47
  const element = <Code prop="abc" />;
48
48
  `,
49
- 'should not transform if removable props are not preset',
50
- );
51
-
52
- describe('when only one prop present', () => {
53
- defineInlineTest(
54
- { default: transformer, parser: 'tsx' },
55
- {},
56
- `
49
+ 'should not transform if removable props are not preset',
50
+ );
51
+
52
+ describe('when only one prop present', () => {
53
+ defineInlineTest(
54
+ { default: transformer, parser: 'tsx' },
55
+ {},
56
+ `
57
57
  import React from 'react';
58
58
  import { Code } from '@atlaskit/code';
59
59
 
@@ -65,7 +65,7 @@ describe('Remove props', () => {
65
65
 
66
66
  const element = <Code prop="abc" ${removePropsMapping.lineNumberContainerStyle}={{ fontSize: '14px' }} />;
67
67
  `,
68
- `
68
+ `
69
69
  import React from 'react';
70
70
  import { Code } from '@atlaskit/code';
71
71
 
@@ -77,13 +77,13 @@ describe('Remove props', () => {
77
77
 
78
78
  const element = <Code prop="abc" />;
79
79
  `,
80
- `removes "${removePropsMapping.lineNumberContainerStyle}" "JSXAttribute" prop`,
81
- );
80
+ `removes "${removePropsMapping.lineNumberContainerStyle}" "JSXAttribute" prop`,
81
+ );
82
82
 
83
- defineInlineTest(
84
- { default: transformer, parser: 'tsx' },
85
- {},
86
- `
83
+ defineInlineTest(
84
+ { default: transformer, parser: 'tsx' },
85
+ {},
86
+ `
87
87
  import React from 'react';
88
88
  import { Code } from '@atlaskit/code';
89
89
 
@@ -102,7 +102,7 @@ describe('Remove props', () => {
102
102
 
103
103
  const Component3 = () => <Code prop="abc" {...foo} { ...{ ${removePropsMapping.lineNumberContainerStyle}: { fontSize: '24px' }, key: 'hello' } } {...bar} />;
104
104
  `,
105
- `
105
+ `
106
106
  import React from 'react';
107
107
  import { Code } from '@atlaskit/code';
108
108
 
@@ -120,14 +120,14 @@ describe('Remove props', () => {
120
120
  key: 'hello'
121
121
  } } {...bar} />;
122
122
  `,
123
- `removes "${removePropsMapping.lineNumberContainerStyle}" "JSXSpreadAttribute" prop`,
124
- );
125
- });
126
-
127
- defineInlineTest(
128
- { default: transformer, parser: 'tsx' },
129
- {},
130
- `
123
+ `removes "${removePropsMapping.lineNumberContainerStyle}" "JSXSpreadAttribute" prop`,
124
+ );
125
+ });
126
+
127
+ defineInlineTest(
128
+ { default: transformer, parser: 'tsx' },
129
+ {},
130
+ `
131
131
  import React from 'react';
132
132
  import { Code } from '@atlaskit/code';
133
133
 
@@ -165,7 +165,7 @@ describe('Remove props', () => {
165
165
 
166
166
  const element = <Code prop="abc" ${removePropsMapping.lineNumberContainerStyle}={{ fontSize: '14px' }} ${removePropsMapping.highlight}="2-4" />;
167
167
  `,
168
- `
168
+ `
169
169
  import React from 'react';
170
170
  import { Code } from '@atlaskit/code';
171
171
 
@@ -196,6 +196,6 @@ describe('Remove props', () => {
196
196
 
197
197
  const element = <Code prop="abc" />;
198
198
  `,
199
- 'removes mixture of removable props',
200
- );
199
+ 'removes mixture of removable props',
200
+ );
201
201
  });