Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
SacDeNoeuds committed Dec 9, 2024
1 parent 1b12ac6 commit 3b4eca2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
56 changes: 28 additions & 28 deletions site/development/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,40 +108,40 @@ export function load(app: Application) {

Start by writing a `jsx.d.ts` file somewhere.

```ts
````ts
// src/jsx.d.ts
import { JSX as TypeDocJSX } from 'typedoc'
import { JSX as TypeDocJSX } from "typedoc";

declare module 'typedoc' {
namespace JSX {
declare module "typedoc" {
namespace JSX {
interface IntrinsicAttributes {
popover?: boolean
popovertarget?: string
popovertargetaction?: 'hide' | 'show' | 'toggle'
}
interface IntrinsicElements {
// add your custom elements here, ie:
/**
* @example
* ```tsx
* <drop-down trigger="#my-trigger" class="header-menu">
* <button>Option #1</button>
* <button>Option #2</button>
* </drop-down>
* ```
*/
'drop-down': IntrinsicAttributes & {
/**
* A query selector, ie: '#my-trigger'
*/
trigger: string
namespace JSX {
interface IntrinsicAttributes {
popover?: boolean;
popovertarget?: string;
popovertargetaction?: "hide" | "show" | "toggle";
}
interface IntrinsicElements {
// add your custom elements here, ie:
/**
* @example
* ```tsx
* <drop-down trigger="#my-trigger" class="header-menu">
* <button>Option #1</button>
* <button>Option #2</button>
* </drop-down>
* ```
*/
"drop-down": IntrinsicAttributes & {
/**
* A query selector, ie: '#my-trigger'
*/
trigger: string;
};
}
}
}
}
}
}
```
````

Then in your plugin entry point, reference the `jsx.d.ts` file with a triple-slash directive.

Expand Down
6 changes: 3 additions & 3 deletions src/lib/utils/jsx.elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ export interface JsxHtmlGlobalProps {
*
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) for more details
*/
popover?: boolean | 'auto' | 'manual'
popover?: boolean | "auto" | "manual";
/**
* It must be the popover element id, see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
*/
popovertarget?: string
popovertargetaction?: 'hide' | 'show' | 'toggle'
popovertarget?: string;
popovertargetaction?: "hide" | "show" | "toggle";
}

/**
Expand Down
6 changes: 5 additions & 1 deletion src/lib/utils/jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ export function Raw(_props: { html: string }) {
* @hidden
*/
export declare namespace JSX {
export { IntrinsicElements, JsxElement as Element, JsxHtmlGlobalProps as IntrinsicAttributes };
export {
IntrinsicElements,
JsxElement as Element,
JsxHtmlGlobalProps as IntrinsicAttributes,
};
}

const voidElements = new Set([
Expand Down

0 comments on commit 3b4eca2

Please sign in to comment.