Skip to content

Commit 45b29e4

Browse files
committed
chore: format files with prettier
1 parent e66fd7d commit 45b29e4

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Super powerful structural search and replace for JavaScript and TypeScript to au
5656
- [`FindOptions.where` (`{ [captureName: string]: (path: Astx) => boolean }`)](#findoptionswhere--capturename-string-path-astx--boolean-)
5757
- [`.find(...).replace(...)` (`void`)](#findreplace-void)
5858
- [`.size()` (`number`)](#size-number)
59-
- [`` [name: `$${string}` | `$$${string}` | `$$$${string}`] `` (`Astx`)](#name-string--string--string-astx)
59+
- [``[name: `$${string}` | `$$${string}` | `$$$${string}`]`` (`Astx`)](#name-string--string--string-astx)
6060
- [`.placeholder` (`string | undefined`)](#placeholder-string--undefined)
6161
- [`.node` (`Node`)](#node-node)
6262
- [`.path` (`NodePath`)](#path-nodepath)
@@ -479,7 +479,7 @@ Matches nodes that match all of the given patterns. This is mostly useful for na
479479

480480
### `$Maybe<pattern>`
481481

482-
Matches either the given type annotation or no node in its place. For example `let $a: $Maybe<number>` will match `let foo: number` and `let foo` (with no type annotation), but not ` let foo: string``let foo: string `.
482+
Matches either the given type annotation or no node in its place. For example `let $a: $Maybe<number>` will match `let foo: number` and `let foo` (with no type annotation), but not `let foo: string``let foo: string`.
483483

484484
### `$Or<...>`
485485

@@ -533,14 +533,14 @@ For example if you do `astx.find('foo($$args)').find('$a + $b')`, the second `fi
533533

534534
You can call `.find` as a method or tagged template literal:
535535

536-
- `` .find`pattern`(options?: FindOptions) ``
536+
- ``.find`pattern`(options?: FindOptions)``
537537
- `.find(pattern: string | string[] | Node | Node[] | NodePath | NodePath[], options?: FindOptions)`
538538

539539
If you give the pattern as a string, it must be a valid expression or statement(s). Otherwise it should be valid
540540
AST node(s) you already parsed or constructed.
541541
You can interpolate strings, AST nodes, arrays of AST nodes, and `Astx` instances in the tagged template literal.
542542

543-
For example you could do `` astx.find`${t.identifier('foo')} + 3`() ``.
543+
For example you could do ``astx.find`${t.identifier('foo')} + 3`()``.
544544

545545
Or you could match multiple statements by doing
546546

@@ -574,7 +574,7 @@ Finds and replaces matches for the given pattern within `root`.
574574

575575
There are several different ways you can call `.replace`. You can call `.find` in any way described above.
576576

577-
- `` .find(...).replace`replacement`() ``
577+
- ``.find(...).replace`replacement`()``
578578
- `.find(...).replace(replacement: string | string | Node | Node[])`
579579
- `.find(...).replace(replacement: (match: Astx, parse: ParsePattern) => string)`
580580
- `.find(...).replace(replacement: (match: Astx, parse: ParsePattern) => Node | Node[])`
@@ -594,7 +594,7 @@ astx
594594

595595
Returns the number of matches from the `.find()` or `.closest()` call that returned this instance.
596596

597-
### `` [name: `$${string}` | `$$${string}` | `$$$${string}`] `` (`Astx`)
597+
### ``[name: `$${string}` | `$$${string}` | `$$$${string}`]`` (`Astx`)
598598

599599
Gets an `Astx` instance focused on the capture(s) with the given `name`.
600600

src/util/CodeFrameError.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ export default class CodeFrameError extends Error {
122122
return dedent`
123123
${red(`Error in ${filename} (${start.line}:${start.column})`)}
124124
${codeFrameColumns(source, { start, end }, { message, ...options })}${
125-
options.stack && stack
126-
? '\n' + red(stack?.replace(/^.*?(\r\n?|\n)/, ''))
127-
: ''
128-
}
125+
options.stack && stack
126+
? '\n' + red(stack?.replace(/^.*?(\r\n?|\n)/, ''))
127+
: ''
128+
}
129129
`
130130
}
131131
}

0 commit comments

Comments
 (0)