@@ -17,7 +17,9 @@ However, it is also available for use outside of this project and compatible wit
1717
1818## Imports
1919
20- ### ` hasImportDeclaration(j, source, sourcePath) `
20+ ### ` hasImportDeclaration `
21+
22+ ` hasImportDeclaration(j, source, sourcePath) `
2123
2224Finds an import declaration by source name
2325
@@ -38,7 +40,9 @@ import { hasImportDeclaration } from '@codeshift/utils';
3840hasImportDeclaration (j, source, ' react' ); // True
3941```
4042
41- ### ` getImportDeclaration(j, source, sourcePath) `
43+ ### ` getImportDeclaration `
44+
45+ ` getImportDeclaration(j, source, sourcePath) `
4246
4347Returns an import declaration by source name
4448
@@ -59,7 +63,9 @@ import { getImportDeclaration } from '@codeshift/utils';
5963getImportDeclaration (j, source, ' react' );
6064```
6165
62- ### ` removeImportDeclaration(j, source, sourcePath) `
66+ ### ` removeImportDeclaration `
67+
68+ ` removeImportDeclaration(j, source, sourcePath) `
6369
6470Removes an import declaration by source name
6571
@@ -85,7 +91,9 @@ removeImportDeclaration(j, source, 'react');
8591- import React, { useEffect } from 'react';
8692```
8793
88- ### ` renameImportDeclaration(j, source, sourcePath, newSourcePath) `
94+ ### ` renameImportDeclaration `
95+
96+ ` renameImportDeclaration(j, source, sourcePath, newSourcePath) `
8997
9098Renames an import declaration by source name
9199
@@ -112,7 +120,9 @@ renameImportDeclaration(j, source, 'react', 'preact');
112120+ import React, { useEffect } from 'preact';
113121```
114122
115- ### ` getDefaultImportSpecifier(j, source, sourcePath) `
123+ ### ` getDefaultImportSpecifier `
124+
125+ ` getDefaultImportSpecifier(j, source, sourcePath) `
116126
117127Finds a default import specifier
118128
@@ -133,7 +143,9 @@ import { getDefaultImportSpecifier } from '@codeshift/utils';
133143getDefaultImportSpecifier (j, source, ' react' ); // Collection containing 'React'
134144```
135145
136- ### ` getDefaultImportSpecifierName(j, source, sourcePath) `
146+ ### ` getDefaultImportSpecifierName `
147+
148+ ` getDefaultImportSpecifierName(j, source, sourcePath) `
137149
138150Finds a default import specifier and returns its name
139151
@@ -154,7 +166,9 @@ import { getDefaultImportSpecifierName } from '@codeshift/utils';
154166getDefaultImportSpecifierName (j, source, ' react' ); // Collection containing 'React'
155167```
156168
157- ### ` hasDefaultImportSpecifier(j, source, sourcePath) `
169+ ### ` hasDefaultImportSpecifier `
170+
171+ ` hasDefaultImportSpecifier(j, source, sourcePath) `
158172
159173Attempts to find a default import specifier and returns a boolean result
160174
@@ -175,7 +189,9 @@ import { hasDefaultImportSpecifier } from '@codeshift/utils';
175189hasDefaultImportSpecifier (j, source, ' react' ); // True
176190```
177191
178- ### ` removeDefaultImportSpecifier(j, source, sourcePath) `
192+ ### ` removeDefaultImportSpecifier `
193+
194+ ` removeDefaultImportSpecifier(j, source, sourcePath) `
179195
180196Attempts to remove a default import specifier
181197
@@ -201,7 +217,9 @@ removeDefaultImportSpecifier(j, source, 'React');
201217+ import { useEffect } from 'react';
202218```
203219
204- ### ` hasImportSpecifier(j, source, sourcePath) `
220+ ### ` hasImportSpecifier `
221+
222+ ` hasImportSpecifier(j, source, sourcePath) `
205223
206224Checks for an import import specifier
207225
@@ -222,7 +240,9 @@ import { hasImportSpecifier } from '@codeshift/utils';
222240hasImportSpecifier (j, source, ' react' , ' useEffect' ); // True
223241```
224242
225- ### ` getImportSpecifier(j, specifier, source) `
243+ ### ` getImportSpecifier `
244+
245+ ` getImportSpecifier(j, specifier, source) `
226246
227247Finds an import specifier by name
228248
@@ -243,7 +263,9 @@ import { getImportSpecifier } from '@codeshift/utils';
243263getImportSpecifier (j, source, ' useEffect' ); // Collection containing 'useEffect'
244264```
245265
246- ### ` getImportSpecifierName(j, specifier, source) `
266+ ### ` getImportSpecifierName `
267+
268+ ` getImportSpecifierName(j, specifier, source) `
247269
248270Returns the local name of an import. This is useful for cases where an import specifier is potentially aliased.
249271
@@ -264,7 +286,9 @@ import { getImportSpecifierName } from '@codeshift/utils';
264286getImportSpecifierName (j, source, ' useEffect' , ' react' ); // 'foo'
265287```
266288
267- ### ` insertImportSpecifier(j, source, specifier) `
289+ ### ` insertImportSpecifier `
290+
291+ ` insertImportSpecifier(j, source, specifier) `
268292
269293Inserts an import specifier
270294
@@ -293,7 +317,9 @@ insertImportSpecifier(j, source, 'useMemo', 'react'); // Collection containing '
293317
294318## JSX
295319
296- ### ` getJSXAttributes(j, source, attributeName) `
320+ ### ` getJSXAttributes `
321+
322+ ` getJSXAttributes(j, source, attributeName) `
297323
298324Finds a JSX attributeName (aka prop) by name
299325
@@ -316,7 +342,9 @@ import { getJSXAttributes } from '@codeshift/utils';
316342getJSXAttributes (j, source, ' primary' ); // Collection containing 'primary'
317343```
318344
319- ### ` hasJSXAttributes(j, source, attributeName) `
345+ ### ` hasJSXAttributes `
346+
347+ ` hasJSXAttributes(j, source, attributeName) `
320348
321349Finds a JSX attributeName (aka prop) by name and returns true if found
322350
@@ -341,7 +369,9 @@ hasJSXAttributes(j, source, 'primary'); // Found!
341369
342370## Comments
343371
344- ### ` insertCommentBefore(j, source, message, prefix) `
372+ ### ` insertCommentBefore `
373+
374+ ` insertCommentBefore(j, source, message, prefix) `
345375
346376Appends a comment before the provided node
347377
@@ -376,7 +406,9 @@ import React from 'react';
376406const App = () => < Button primary> Say hello< / Button> ;
377407```
378408
379- ### ` insertCommentToStartOfFile(j, source, message) `
409+ ### ` insertCommentToStartOfFile `
410+
411+ ` insertCommentToStartOfFile(j, source, message) `
380412
381413Appends a comment to the start of a file
382414
@@ -413,7 +445,9 @@ const App = () => <Button primary>Say hello</Button>;
413445
414446## Motions
415447
416- ### ` applyMotions(j, source, motions) `
448+ ### ` applyMotions `
449+
450+ ` applyMotions(j, source, motions) `
417451
418452A helper function to apply an array of motions in sequence.
419453
0 commit comments