@atlaskit/menu 2.4.0 → 2.5.0

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 +20 -1
  2. package/__perf__/button.tsx +7 -9
  3. package/__perf__/custom.tsx +13 -17
  4. package/__perf__/link.tsx +6 -6
  5. package/__perf__/utils/example-runner.tsx +36 -41
  6. package/__perf__/utils/interaction-tasks.tsx +63 -86
  7. package/codemods/0.7.0-change-css-fn-prop.tsx +128 -156
  8. package/codemods/2.1.0-invalid-link-item-to-button-item.tsx +121 -145
  9. package/codemods/__tests__/0.7.0-change-css-fn-prop.tsx +77 -77
  10. package/codemods/__tests__/next-invalid-link-item-to-button-item.tsx +117 -117
  11. package/codemods/helpers/generic.tsx +528 -564
  12. package/dist/cjs/internal/components/menu-item-primitive.js +13 -2
  13. package/dist/cjs/internal/components/skeleton-shimmer.js +6 -0
  14. package/dist/cjs/menu-item/button-item.js +4 -0
  15. package/dist/cjs/menu-item/custom-item.js +8 -2
  16. package/dist/cjs/menu-item/heading-item.js +12 -2
  17. package/dist/cjs/menu-item/link-item.js +4 -0
  18. package/dist/cjs/menu-item/skeleton-heading-item.js +12 -1
  19. package/dist/cjs/menu-item/skeleton-item.js +25 -1
  20. package/dist/cjs/menu-section/menu-group.js +4 -0
  21. package/dist/cjs/menu-section/popup-menu-group.js +4 -0
  22. package/dist/cjs/menu-section/section.js +19 -4
  23. package/dist/es2019/internal/components/menu-item-primitive.js +13 -2
  24. package/dist/es2019/internal/components/skeleton-shimmer.js +5 -0
  25. package/dist/es2019/menu-item/button-item.js +5 -0
  26. package/dist/es2019/menu-item/custom-item.js +9 -2
  27. package/dist/es2019/menu-item/heading-item.js +13 -2
  28. package/dist/es2019/menu-item/link-item.js +5 -0
  29. package/dist/es2019/menu-item/skeleton-heading-item.js +11 -1
  30. package/dist/es2019/menu-item/skeleton-item.js +24 -1
  31. package/dist/es2019/menu-section/menu-group.js +4 -0
  32. package/dist/es2019/menu-section/popup-menu-group.js +4 -0
  33. package/dist/es2019/menu-section/section.js +20 -4
  34. package/dist/esm/internal/components/menu-item-primitive.js +13 -2
  35. package/dist/esm/internal/components/skeleton-shimmer.js +5 -0
  36. package/dist/esm/menu-item/button-item.js +5 -0
  37. package/dist/esm/menu-item/custom-item.js +9 -2
  38. package/dist/esm/menu-item/heading-item.js +13 -2
  39. package/dist/esm/menu-item/link-item.js +5 -0
  40. package/dist/esm/menu-item/skeleton-heading-item.js +11 -1
  41. package/dist/esm/menu-item/skeleton-item.js +24 -1
  42. package/dist/esm/menu-section/menu-group.js +4 -0
  43. package/dist/esm/menu-section/popup-menu-group.js +4 -0
  44. package/dist/esm/menu-section/section.js +20 -4
  45. package/dist/types/internal/components/skeleton-shimmer.d.ts +4 -1
  46. package/dist/types/menu-item/custom-item.d.ts +3 -0
  47. package/dist/types/menu-section/menu-group.d.ts +3 -0
  48. package/dist/types/menu-section/popup-menu-group.d.ts +3 -0
  49. package/dist/types-ts4.5/internal/components/skeleton-shimmer.d.ts +4 -1
  50. package/dist/types-ts4.5/menu-item/custom-item.d.ts +3 -0
  51. package/dist/types-ts4.5/menu-section/menu-group.d.ts +3 -0
  52. package/dist/types-ts4.5/menu-section/popup-menu-group.d.ts +3 -0
  53. package/package.json +133 -133
  54. package/report.api.md +130 -138
@@ -1,177 +1,149 @@
1
1
  import { type NodePath } from 'ast-types/lib/node-path';
2
2
  import type {
3
- API,
4
- ASTPath,
5
- default as core,
6
- FileInfo,
7
- ImportDeclaration,
8
- ImportSpecifier,
9
- Options,
3
+ API,
4
+ ASTPath,
5
+ default as core,
6
+ FileInfo,
7
+ ImportDeclaration,
8
+ ImportSpecifier,
9
+ Options,
10
10
  } from 'jscodeshift';
11
11
 
12
- import {
13
- addCommentBeforeJSX,
14
- getDefaultSpecifierName,
15
- } from './helpers/generic';
16
-
17
- function getJSXAttributesByName(
18
- j: core.JSCodeshift,
19
- element: ASTPath<any>,
20
- attributeName: string,
21
- ) {
22
- return j(element)
23
- .find(j.JSXOpeningElement)
24
- .find(j.JSXAttribute)
25
- .filter((attribute) => {
26
- const matches = j(attribute)
27
- .find(j.JSXIdentifier)
28
- .filter((identifier) => identifier.value.name === attributeName);
29
- return Boolean(matches.length);
30
- });
12
+ import { addCommentBeforeJSX, getDefaultSpecifierName } from './helpers/generic';
13
+
14
+ function getJSXAttributesByName(j: core.JSCodeshift, element: ASTPath<any>, attributeName: string) {
15
+ return j(element)
16
+ .find(j.JSXOpeningElement)
17
+ .find(j.JSXAttribute)
18
+ .filter((attribute) => {
19
+ const matches = j(attribute)
20
+ .find(j.JSXIdentifier)
21
+ .filter((identifier) => identifier.value.name === attributeName);
22
+ return Boolean(matches.length);
23
+ });
31
24
  }
32
25
 
33
26
  function getImportSpecifier(
34
- j: core.JSCodeshift,
35
- source: ReturnType<typeof j>,
36
- specifier: string,
37
- imported: string,
27
+ j: core.JSCodeshift,
28
+ source: ReturnType<typeof j>,
29
+ specifier: string,
30
+ imported: string,
38
31
  ) {
39
- const specifiers = source
40
- .find(j.ImportDeclaration)
41
- .filter(
42
- (path: ASTPath<ImportDeclaration>) =>
43
- path.node.source.value === specifier,
44
- )
45
- .find(j.ImportSpecifier)
46
- .filter(
47
- (path: ASTPath<ImportSpecifier>) => path.value.imported.name === imported,
48
- );
49
-
50
- if (!specifiers.length) {
51
- return null;
52
- }
53
-
54
- return specifiers.nodes()[0]!.local!.name;
32
+ const specifiers = source
33
+ .find(j.ImportDeclaration)
34
+ .filter((path: ASTPath<ImportDeclaration>) => path.node.source.value === specifier)
35
+ .find(j.ImportSpecifier)
36
+ .filter((path: ASTPath<ImportSpecifier>) => path.value.imported.name === imported);
37
+
38
+ if (!specifiers.length) {
39
+ return null;
40
+ }
41
+
42
+ return specifiers.nodes()[0]!.local!.name;
55
43
  }
56
44
 
57
- function updateCssFnProp(
58
- j: core.JSCodeshift,
59
- source: ReturnType<typeof j>,
60
- specifier: string,
61
- ) {
62
- source.findJSXElements(specifier).forEach((element) => {
63
- const cssFnPropCollection = getJSXAttributesByName(j, element, 'cssFn');
64
-
65
- // no cssProp usage for this element
66
- if (!cssFnPropCollection.length) {
67
- return;
68
- }
69
-
70
- const cssFnProp = cssFnPropCollection.get();
71
-
72
- const cssFnExpression: NodePath = j(cssFnProp)
73
- .find(j.JSXExpressionContainer)
74
- .find(j.Expression)
75
- .get();
76
-
77
- if (cssFnExpression) {
78
- // just remove the state styles param
79
- try {
80
- const [stylePropName] = cssFnExpression!.value.params;
81
- j(cssFnExpression)
82
- .find(j.SpreadElement)
83
- .forEach((n) => {
84
- // discerns whether there are multiple identifiers here
85
- const isComplexIdentifier = j(n).find(j.Identifier).length > 1;
86
-
87
- if (isComplexIdentifier) {
88
- throw new Error(
89
- 'CSSFn Prop codemod: Unable to parse spread element',
90
- );
91
- }
92
-
93
- const hasStyleProp = !!j(n)
94
- .find(j.Identifier)
95
- .filter((node) => node.value.name === stylePropName.name).length;
96
- if (hasStyleProp) {
97
- j(n).remove();
98
- }
99
- });
100
-
101
- cssFnExpression!.value.params.shift();
102
- } catch (e) {
103
- addCommentBeforeJSX(
104
- j,
105
- cssFnProp,
106
- `
45
+ function updateCssFnProp(j: core.JSCodeshift, source: ReturnType<typeof j>, specifier: string) {
46
+ source.findJSXElements(specifier).forEach((element) => {
47
+ const cssFnPropCollection = getJSXAttributesByName(j, element, 'cssFn');
48
+
49
+ // no cssProp usage for this element
50
+ if (!cssFnPropCollection.length) {
51
+ return;
52
+ }
53
+
54
+ const cssFnProp = cssFnPropCollection.get();
55
+
56
+ const cssFnExpression: NodePath = j(cssFnProp)
57
+ .find(j.JSXExpressionContainer)
58
+ .find(j.Expression)
59
+ .get();
60
+
61
+ if (cssFnExpression) {
62
+ // just remove the state styles param
63
+ try {
64
+ const [stylePropName] = cssFnExpression!.value.params;
65
+ j(cssFnExpression)
66
+ .find(j.SpreadElement)
67
+ .forEach((n) => {
68
+ // discerns whether there are multiple identifiers here
69
+ const isComplexIdentifier = j(n).find(j.Identifier).length > 1;
70
+
71
+ if (isComplexIdentifier) {
72
+ throw new Error('CSSFn Prop codemod: Unable to parse spread element');
73
+ }
74
+
75
+ const hasStyleProp = !!j(n)
76
+ .find(j.Identifier)
77
+ .filter((node) => node.value.name === stylePropName.name).length;
78
+ if (hasStyleProp) {
79
+ j(n).remove();
80
+ }
81
+ });
82
+
83
+ cssFnExpression!.value.params.shift();
84
+ } catch (e) {
85
+ addCommentBeforeJSX(
86
+ j,
87
+ cssFnProp,
88
+ `
107
89
  The usage of the 'cssFn' prop in this component could not be transformed and requires manual intervention.
108
90
  The 'cssFn' prop has been simplified so that users no longer need to merge the inherited styles with their own overrides.
109
91
  For more info please reach out to #help-design-system-code.
110
92
  `,
111
- );
112
- }
113
- }
114
- });
93
+ );
94
+ }
95
+ }
96
+ });
115
97
  }
116
98
 
117
99
  function hasImportDeclaration(
118
- j: core.JSCodeshift,
119
- source: ReturnType<typeof j>,
120
- importPath: string,
100
+ j: core.JSCodeshift,
101
+ source: ReturnType<typeof j>,
102
+ importPath: string,
121
103
  ) {
122
- return !!source
123
- .find(j.ImportDeclaration)
124
- .filter((path) => path.node.source.value === importPath).length;
104
+ return !!source.find(j.ImportDeclaration).filter((path) => path.node.source.value === importPath)
105
+ .length;
125
106
  }
126
107
 
127
- export default function transformer(
128
- fileInfo: FileInfo,
129
- { jscodeshift: j }: API,
130
- options: Options,
131
- ) {
132
- const source = j(fileInfo.source);
133
-
134
- if (hasImportDeclaration(j, source, '@atlaskit/menu')) {
135
- const defaultSpecifier = getDefaultSpecifierName({
136
- j,
137
- base: source,
138
- packageName: '@atlaskit/menu',
139
- });
140
-
141
- if (defaultSpecifier != null) {
142
- updateCssFnProp(j, source, defaultSpecifier);
143
- }
144
-
145
- [
146
- 'ButtonItem',
147
- 'LinkItem',
148
- 'CustomItem',
149
- 'HeadingItem',
150
- 'SkeletonItem',
151
- 'SkeletonHeadingItem',
152
- 'MenuGroup',
153
- 'PopupMenuGroup',
154
- 'Section',
155
- ].forEach((pkg) => {
156
- const importSpecifier = getImportSpecifier(
157
- j,
158
- source,
159
- '@atlaskit/menu',
160
- pkg,
161
- );
162
-
163
- if (importSpecifier != null) {
164
- updateCssFnProp(j, source, importSpecifier);
165
- }
166
- });
167
-
168
- return source.toSource(
169
- options.printOptions || {
170
- quote: 'single',
171
- trailingComma: true,
172
- },
173
- );
174
- }
175
-
176
- return fileInfo.source;
108
+ export default function transformer(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) {
109
+ const source = j(fileInfo.source);
110
+
111
+ if (hasImportDeclaration(j, source, '@atlaskit/menu')) {
112
+ const defaultSpecifier = getDefaultSpecifierName({
113
+ j,
114
+ base: source,
115
+ packageName: '@atlaskit/menu',
116
+ });
117
+
118
+ if (defaultSpecifier != null) {
119
+ updateCssFnProp(j, source, defaultSpecifier);
120
+ }
121
+
122
+ [
123
+ 'ButtonItem',
124
+ 'LinkItem',
125
+ 'CustomItem',
126
+ 'HeadingItem',
127
+ 'SkeletonItem',
128
+ 'SkeletonHeadingItem',
129
+ 'MenuGroup',
130
+ 'PopupMenuGroup',
131
+ 'Section',
132
+ ].forEach((pkg) => {
133
+ const importSpecifier = getImportSpecifier(j, source, '@atlaskit/menu', pkg);
134
+
135
+ if (importSpecifier != null) {
136
+ updateCssFnProp(j, source, importSpecifier);
137
+ }
138
+ });
139
+
140
+ return source.toSource(
141
+ options.printOptions || {
142
+ quote: 'single',
143
+ trailingComma: true,
144
+ },
145
+ );
146
+ }
147
+
148
+ return fileInfo.source;
177
149
  }
@@ -1,170 +1,146 @@
1
1
  import type {
2
- API,
3
- ASTPath,
4
- default as core,
5
- FileInfo,
6
- ImportDeclaration,
7
- ImportSpecifier,
8
- Options,
2
+ API,
3
+ ASTPath,
4
+ default as core,
5
+ FileInfo,
6
+ ImportDeclaration,
7
+ ImportSpecifier,
8
+ Options,
9
9
  } from 'jscodeshift';
10
10
 
11
11
  const invalidHrefValues = ['', '#'];
12
12
  const pkg = '@atlaskit/menu';
13
13
 
14
- function getJSXAttributesByName(
15
- j: core.JSCodeshift,
16
- element: ASTPath<any>,
17
- attributeName: string,
18
- ) {
19
- return j(element)
20
- .find(j.JSXOpeningElement)
21
- .find(j.JSXAttribute)
22
- .filter((attribute) => {
23
- const matches = j(attribute)
24
- .find(j.JSXIdentifier)
25
- .filter((identifier) => identifier.value.name === attributeName);
26
- return Boolean(matches.length);
27
- });
14
+ function getJSXAttributesByName(j: core.JSCodeshift, element: ASTPath<any>, attributeName: string) {
15
+ return j(element)
16
+ .find(j.JSXOpeningElement)
17
+ .find(j.JSXAttribute)
18
+ .filter((attribute) => {
19
+ const matches = j(attribute)
20
+ .find(j.JSXIdentifier)
21
+ .filter((identifier) => identifier.value.name === attributeName);
22
+ return Boolean(matches.length);
23
+ });
28
24
  }
29
25
 
30
26
  function getImportSpecifier(
31
- j: core.JSCodeshift,
32
- source: ReturnType<typeof j>,
33
- specifier: string,
34
- imported: string,
27
+ j: core.JSCodeshift,
28
+ source: ReturnType<typeof j>,
29
+ specifier: string,
30
+ imported: string,
35
31
  ) {
36
- const specifiers = source
37
- .find(j.ImportDeclaration)
38
- .filter(
39
- (path: ASTPath<ImportDeclaration>) =>
40
- path.node.source.value === specifier,
41
- )
42
- .find(j.ImportSpecifier)
43
- .filter(
44
- (path: ASTPath<ImportSpecifier>) => path.value.imported.name === imported,
45
- );
46
-
47
- if (!specifiers.length) {
48
- return null;
49
- }
50
-
51
- return specifiers.nodes()[0]!.local!.name;
32
+ const specifiers = source
33
+ .find(j.ImportDeclaration)
34
+ .filter((path: ASTPath<ImportDeclaration>) => path.node.source.value === specifier)
35
+ .find(j.ImportSpecifier)
36
+ .filter((path: ASTPath<ImportSpecifier>) => path.value.imported.name === imported);
37
+
38
+ if (!specifiers.length) {
39
+ return null;
40
+ }
41
+
42
+ return specifiers.nodes()[0]!.local!.name;
52
43
  }
53
44
 
54
45
  function convertInvalidLinkItemsToButtonItems(
55
- j: core.JSCodeshift,
56
- source: ReturnType<typeof j>,
57
- specifier: string,
46
+ j: core.JSCodeshift,
47
+ source: ReturnType<typeof j>,
48
+ specifier: string,
58
49
  ) {
59
- // For each instance of LinkItem
60
- source.findJSXElements(specifier).forEach((element) => {
61
- const hrefPropCollection = getJSXAttributesByName(j, element, 'href');
62
-
63
- // base case: no `href` prop exists, it is invalid
64
- let validHref = false;
65
-
66
- // if `href` exists
67
- if (hrefPropCollection.length > 0) {
68
- const hrefProp = hrefPropCollection.get();
69
-
70
- const hrefStringLiteral = j(hrefProp).find(j.StringLiteral);
71
- const hrefExpressionContainer = j(hrefProp)
72
- .find(j.JSXExpressionContainer)
73
- .find(j.Expression);
74
-
75
- // This is tin foil hattery. Can something be neither a string literal
76
- // nor an expression container? Don't know but gonna cover that
77
- if (
78
- hrefStringLiteral.length === 0 &&
79
- hrefExpressionContainer.length === 0
80
- ) {
81
- return;
82
- }
83
-
84
- if (hrefStringLiteral.length > 0) {
85
- const hrefValue = hrefStringLiteral.get().value.value;
86
- if (invalidHrefValues.includes(hrefValue)) {
87
- j(hrefProp).forEach((el) => j(el).remove());
88
- } else {
89
- validHref = true;
90
- }
91
- } else {
92
- // It seems foolish to try and resolve variables, so we will assume it
93
- // is valid
94
- validHref = true;
95
- }
96
- }
97
-
98
- if (!validHref) {
99
- const pkgImport = source
100
- .find(j.ImportDeclaration)
101
- .filter((path) => path.node.source.value === pkg);
102
- const buttonItemIsImported =
103
- pkgImport
104
- .find(j.ImportSpecifier)
105
- .nodes()
106
- .filter((node) => node.imported.name === 'ButtonItem').length > 0;
107
- if (!buttonItemIsImported) {
108
- // Add ButtonItem to imports
109
- const newSpecifier = j.importSpecifier(j.identifier('ButtonItem'));
110
- pkgImport.forEach((moduleImport) => {
111
- const specifiers = moduleImport.node.specifiers
112
- ? [...moduleImport.node.specifiers]
113
- : [];
114
- j(moduleImport).replaceWith(
115
- j.importDeclaration(
116
- specifiers.concat([newSpecifier]),
117
- moduleImport.node.source,
118
- ),
119
- );
120
- });
121
- }
122
-
123
- // Replace existing LinkItem with ButtonItem, while maintaining the same props
124
- if (element.value.openingElement.name.type === 'JSXIdentifier') {
125
- element.value.openingElement.name.name = 'ButtonItem';
126
- if (
127
- element.value.closingElement &&
128
- element.value.closingElement.name.type === 'JSXIdentifier'
129
- ) {
130
- element.value.closingElement.name.name = 'ButtonItem';
131
- }
132
- }
133
- }
134
- });
50
+ // For each instance of LinkItem
51
+ source.findJSXElements(specifier).forEach((element) => {
52
+ const hrefPropCollection = getJSXAttributesByName(j, element, 'href');
53
+
54
+ // base case: no `href` prop exists, it is invalid
55
+ let validHref = false;
56
+
57
+ // if `href` exists
58
+ if (hrefPropCollection.length > 0) {
59
+ const hrefProp = hrefPropCollection.get();
60
+
61
+ const hrefStringLiteral = j(hrefProp).find(j.StringLiteral);
62
+ const hrefExpressionContainer = j(hrefProp).find(j.JSXExpressionContainer).find(j.Expression);
63
+
64
+ // This is tin foil hattery. Can something be neither a string literal
65
+ // nor an expression container? Don't know but gonna cover that
66
+ if (hrefStringLiteral.length === 0 && hrefExpressionContainer.length === 0) {
67
+ return;
68
+ }
69
+
70
+ if (hrefStringLiteral.length > 0) {
71
+ const hrefValue = hrefStringLiteral.get().value.value;
72
+ if (invalidHrefValues.includes(hrefValue)) {
73
+ j(hrefProp).forEach((el) => j(el).remove());
74
+ } else {
75
+ validHref = true;
76
+ }
77
+ } else {
78
+ // It seems foolish to try and resolve variables, so we will assume it
79
+ // is valid
80
+ validHref = true;
81
+ }
82
+ }
83
+
84
+ if (!validHref) {
85
+ const pkgImport = source
86
+ .find(j.ImportDeclaration)
87
+ .filter((path) => path.node.source.value === pkg);
88
+ const buttonItemIsImported =
89
+ pkgImport
90
+ .find(j.ImportSpecifier)
91
+ .nodes()
92
+ .filter((node) => node.imported.name === 'ButtonItem').length > 0;
93
+ if (!buttonItemIsImported) {
94
+ // Add ButtonItem to imports
95
+ const newSpecifier = j.importSpecifier(j.identifier('ButtonItem'));
96
+ pkgImport.forEach((moduleImport) => {
97
+ const specifiers = moduleImport.node.specifiers ? [...moduleImport.node.specifiers] : [];
98
+ j(moduleImport).replaceWith(
99
+ j.importDeclaration(specifiers.concat([newSpecifier]), moduleImport.node.source),
100
+ );
101
+ });
102
+ }
103
+
104
+ // Replace existing LinkItem with ButtonItem, while maintaining the same props
105
+ if (element.value.openingElement.name.type === 'JSXIdentifier') {
106
+ element.value.openingElement.name.name = 'ButtonItem';
107
+ if (
108
+ element.value.closingElement &&
109
+ element.value.closingElement.name.type === 'JSXIdentifier'
110
+ ) {
111
+ element.value.closingElement.name.name = 'ButtonItem';
112
+ }
113
+ }
114
+ }
115
+ });
135
116
  }
136
117
 
137
118
  function hasImportDeclaration(
138
- j: core.JSCodeshift,
139
- source: ReturnType<typeof j>,
140
- importPath: string,
119
+ j: core.JSCodeshift,
120
+ source: ReturnType<typeof j>,
121
+ importPath: string,
141
122
  ) {
142
- return !!source
143
- .find(j.ImportDeclaration)
144
- .filter((path) => path.node.source.value === importPath).length;
123
+ return !!source.find(j.ImportDeclaration).filter((path) => path.node.source.value === importPath)
124
+ .length;
145
125
  }
146
126
 
147
- export default function transformer(
148
- fileInfo: FileInfo,
149
- { jscodeshift: j }: API,
150
- options: Options,
151
- ) {
152
- const source = j(fileInfo.source);
127
+ export default function transformer(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) {
128
+ const source = j(fileInfo.source);
153
129
 
154
- if (hasImportDeclaration(j, source, pkg)) {
155
- const importSpecifier = getImportSpecifier(j, source, pkg, 'LinkItem');
130
+ if (hasImportDeclaration(j, source, pkg)) {
131
+ const importSpecifier = getImportSpecifier(j, source, pkg, 'LinkItem');
156
132
 
157
- if (importSpecifier != null) {
158
- convertInvalidLinkItemsToButtonItems(j, source, importSpecifier);
159
- }
133
+ if (importSpecifier != null) {
134
+ convertInvalidLinkItemsToButtonItems(j, source, importSpecifier);
135
+ }
160
136
 
161
- return source.toSource(
162
- options.printOptions || {
163
- quote: 'single',
164
- trailingComma: true,
165
- },
166
- );
167
- }
137
+ return source.toSource(
138
+ options.printOptions || {
139
+ quote: 'single',
140
+ trailingComma: true,
141
+ },
142
+ );
143
+ }
168
144
 
169
- return fileInfo.source;
145
+ return fileInfo.source;
170
146
  }