Skip to content

Commit ff0ec66

Browse files
committed
Refactor to use @imports
1 parent 8751478 commit ff0ec66

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

lib/index.js

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
/**
2-
* @typedef {import('hast').Comment} Comment
3-
* @typedef {import('hast').Doctype} Doctype
4-
* @typedef {import('hast').Element} Element
5-
* @typedef {import('hast').ElementContent} ElementContent
6-
* @typedef {import('hast').Nodes} Nodes
7-
* @typedef {import('hast').Properties} Properties
8-
* @typedef {import('hast').Root} Root
9-
* @typedef {import('hast').RootContent} RootContent
10-
* @typedef {import('hast').Text} Text
2+
* @import {
3+
* Comment,
4+
* Doctype,
5+
* ElementContent,
6+
* Element,
7+
* Nodes,
8+
* Properties,
9+
* RootContent,
10+
* Root,
11+
* Text
12+
* } from 'hast'
1113
*/
1214

1315
/**

lib/schema.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @import {Schema} from 'hast-util-sanitize'
3+
*/
4+
15
// Couple of ARIA attributes allowed in several, but not all, places.
26
const aria = ['ariaDescribedBy', 'ariaLabel', 'ariaLabelledBy']
37

@@ -6,7 +10,7 @@ const aria = ['ariaDescribedBy', 'ariaLabel', 'ariaLabelledBy']
610
*
711
* Follows GitHub style sanitation.
812
*
9-
* @type {import('./index.js').Schema}
13+
* @type {Schema}
1014
*/
1115
export const defaultSchema = {
1216
ancestors: {

test/baseline.js

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/**
2-
* @typedef {import('hast').Root} Root
3-
*/
4-
51
import assert from 'node:assert/strict'
62
import fs from 'node:fs/promises'
73
import {ariaAttributes} from 'aria-attributes'

0 commit comments

Comments
 (0)