Skip to content

Commit

Permalink
fix(napi/transform): fix jsdoc links (#5886)
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Sep 19, 2024
1 parent ae89145 commit 127c881
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 5 additions & 3 deletions napi/transform/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface IsolatedDeclarationsResult {
/**
* Configure how TSX and JSX are transformed.
*
* @see [@babel/plugin-transform-react-jsx](https://babeljs.io/docs/babel-plugin-transform-react-jsx#options)
* @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx#options}
*/
export interface ReactBindingOptions {
/**
Expand All @@ -50,7 +50,7 @@ export interface ReactBindingOptions {
*
* @default false
*
* @see [@babel/plugin-transform-react-jsx-development](https://babeljs.io/docs/babel-plugin-transform-react-jsx-development)
* @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx-development}
*/
development?: boolean
/**
Expand All @@ -64,10 +64,12 @@ export interface ReactBindingOptions {
*/
throwIfNamespace?: boolean
/**
* Enables [@babel/plugin-transform-react-pure-annotations](https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations).
* Enables `@babel/plugin-transform-react-pure-annotations`.
*
* It will mark top-level React method calls as pure for tree shaking.
*
* @see {@link https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations}
*
* @default true
*/
pure?: boolean
Expand Down
10 changes: 7 additions & 3 deletions napi/transform/src/options.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(rustdoc::bare_urls)]

use std::path::PathBuf;

use napi::Either;
Expand Down Expand Up @@ -69,7 +71,7 @@ impl From<TypeScriptBindingOptions> for TypeScriptOptions {

/// Configure how TSX and JSX are transformed.
///
/// @see [@babel/plugin-transform-react-jsx](https://babeljs.io/docs/babel-plugin-transform-react-jsx#options)
/// @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx#options}
#[napi(object)]
pub struct ReactBindingOptions {
/// Decides which runtime to use.
Expand All @@ -85,7 +87,7 @@ pub struct ReactBindingOptions {
///
/// @default false
///
/// @see [@babel/plugin-transform-react-jsx-development](https://babeljs.io/docs/babel-plugin-transform-react-jsx-development)
/// @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx-development}
pub development: Option<bool>,

/// Toggles whether or not to throw an error if an XML namespaced tag name
Expand All @@ -97,10 +99,12 @@ pub struct ReactBindingOptions {
/// @default true
pub throw_if_namespace: Option<bool>,

/// Enables [@babel/plugin-transform-react-pure-annotations](https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations).
/// Enables `@babel/plugin-transform-react-pure-annotations`.
///
/// It will mark top-level React method calls as pure for tree shaking.
///
/// @see {@link https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations}
///
/// @default true
pub pure: Option<bool>,

Expand Down

0 comments on commit 127c881

Please sign in to comment.