Skip to content

Commit

Permalink
Refactor code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jun 19, 2024
1 parent 1e0863a commit e1b5162
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ declare const emptyObjectSymbol: unique symbol
/**
* Interface of known results from compilers.
*
* Normally, compilers result in text ({@link Value `Value`} of `vfile`).
* Normally, compilers result in text ({@linkcode Value} of `vfile`).
* When you compile to something else, such as a React node (as in,
* `rehype-react`), you can augment this interface to include that type.
*
Expand All @@ -45,7 +45,7 @@ declare const emptyObjectSymbol: unique symbol
* export {} // You may not need this, but it makes sure the file is a module.
* ```
*
* Use {@link CompileResults `CompileResults`} to access the values.
* Use {@linkcode CompileResults} to access the values.
*/
export interface CompileResultMap {
// Note: if `Value` from `VFile` is changed, this should too.
Expand Down
50 changes: 25 additions & 25 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Acceptable results from compilers.
*
* To register custom results, add them to
* {@link CompileResultMap `CompileResultMap`}.
* {@linkcode CompileResultMap}.
*/

/**
Expand All @@ -28,8 +28,8 @@
* A **compiler** handles the compiling of a syntax tree to something else
* (in most cases, text) (TypeScript type).
*
* It is used in the stringify phase and called with a {@link Node `Node`}
* and {@link VFile `VFile`} representation of the document to compile.
* It is used in the stringify phase and called with a {@linkcode Node}
* and {@linkcode VFile} representation of the document to compile.
* It should return the textual representation of the given tree (typically
* `string`).
*
Expand All @@ -42,7 +42,7 @@
* > result values.
* >
* > To register custom results in TypeScript, add them to
* > {@link CompileResultMap `CompileResultMap`}.
* > {@linkcode CompileResultMap}.
*
* [rehype-react]: https://github.com/rehypejs/rehype-react
* @param {Tree} tree
Expand All @@ -61,9 +61,9 @@
* A **parser** handles the parsing of text to a syntax tree.
*
* It is used in the parse phase and is called with a `string` and
* {@link VFile `VFile`} of the document to parse.
* {@linkcode VFile} of the document to parse.
* It must return the syntax tree representation of the given file
* ({@link Node `Node`}).
* ({@linkcode Node}).
* @param {string} document
* Document to parse.
* @param {VFile} file
Expand Down Expand Up @@ -94,20 +94,20 @@
* @template {Node | string | undefined} [Input=Node]
* Value that is expected as input (default: `Node`).
*
* * If the plugin returns a {@link Transformer `Transformer`}, this
* * If the plugin returns a {@linkcode Transformer}, this
* should be the node it expects.
* * If the plugin sets a {@link Parser `Parser`}, this should be
* * If the plugin sets a {@linkcode Parser}, this should be
* `string`.
* * If the plugin sets a {@link Compiler `Compiler`}, this should be the
* * If the plugin sets a {@linkcode Compiler}, this should be the
* node it expects.
* @template [Output=Input]
* Value that is yielded as output (default: `Input`).
*
* * If the plugin returns a {@link Transformer `Transformer`}, this
* * If the plugin returns a {@linkcode Transformer}, this
* should be the node that that yields.
* * If the plugin sets a {@link Parser `Parser`}, this should be the
* * If the plugin sets a {@linkcode Parser}, this should be the
* node that it yields.
* * If the plugin sets a {@link Compiler `Compiler`}, this should be
* * If the plugin sets a {@linkcode Compiler}, this should be
* result it yields.
* @typedef {(
* (this: Processor, ...parameters: PluginParameters) =>
Expand Down Expand Up @@ -146,20 +146,20 @@
* @template {Node | string | undefined} [Input=undefined]
* Value that is expected as input (optional).
*
* * If the plugin returns a {@link Transformer `Transformer`}, this
* * If the plugin returns a {@linkcode Transformer}, this
* should be the node it expects.
* * If the plugin sets a {@link Parser `Parser`}, this should be
* * If the plugin sets a {@linkcode Parser}, this should be
* `string`.
* * If the plugin sets a {@link Compiler `Compiler`}, this should be the
* * If the plugin sets a {@linkcode Compiler}, this should be the
* node it expects.
* @template [Output=undefined] (optional).
* Value that is yielded as output.
*
* * If the plugin returns a {@link Transformer `Transformer`}, this
* * If the plugin returns a {@linkcode Transformer}, this
* should be the node that that yields.
* * If the plugin sets a {@link Parser `Parser`}, this should be the
* * If the plugin sets a {@linkcode Parser}, this should be the
* node that it yields.
* * If the plugin sets a {@link Compiler `Compiler`}, this should be
* * If the plugin sets a {@linkcode Compiler}, this should be
* result it yields.
* @typedef {(
* [
Expand Down Expand Up @@ -340,10 +340,10 @@
* VFile :
* VFile & {result: Result}
* )} VFileWithOutput
* Type to generate a {@link VFile `VFile`} corresponding to a compiler result.
* Type to generate a {@linkcode VFile} corresponding to a compiler result.
*
* If a result that is not acceptable on a `VFile` is used, that will
* be stored on the `result` field of {@link VFile `VFile`}.
* be stored on the `result` field of {@linkcode VFile}.
*/

import {bail} from 'bail'
Expand Down Expand Up @@ -489,7 +489,7 @@ export class Processor extends CallableInstance {
* @deprecated
* This is a private internal method and should not be used.
* @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
* New *unfrozen* processor ({@link Processor `Processor`}) that is
* New *unfrozen* processor ({@linkcode Processor}) that is
* configured to work the same as its ancestor.
* When the descendant processor is configured in the future it does not
* affect the ancestral processor.
Expand Down Expand Up @@ -525,7 +525,7 @@ export class Processor extends CallableInstance {
* > Call the processor first to create a new unfrozen processor.
*
* > **Note**: to register custom data in TypeScript, augment the
* > {@link Data `Data`} interface.
* > {@linkcode Data} interface.
*
* @example
* This example show how to get and set info:
Expand Down Expand Up @@ -706,7 +706,7 @@ export class Processor extends CallableInstance {
* > result values.
* >
* > To register custom results in TypeScript, add them to
* > {@link CompileResultMap `CompileResultMap`}.
* > {@linkcode CompileResultMap}.
*
* [rehype-react]: https://github.com/rehypejs/rehype-react
*/
Expand Down Expand Up @@ -802,7 +802,7 @@ export class Processor extends CallableInstance {
* > result values.
* >
* > To register custom results in TypeScript, add them to
* > {@link CompileResultMap `CompileResultMap`}.
* > {@linkcode CompileResultMap}.
*
* [rehype-react]: https://github.com/rehypejs/rehype-react
*/
Expand Down Expand Up @@ -988,7 +988,7 @@ export class Processor extends CallableInstance {
* > result values.
* >
* > To register custom results in TypeScript, add them to
* > {@link CompileResultMap `CompileResultMap`}.
* > {@linkcode CompileResultMap}.
*
* [rehype-react]: https://github.com/rehypejs/rehype-react
*/
Expand Down

0 comments on commit e1b5162

Please sign in to comment.