Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f1c5dd7

Browse files
committed
Refactor to use @imports
1 parent 79d3de7 commit f1c5dd7

File tree

13 files changed

+34
-64
lines changed

13 files changed

+34
-64
lines changed

‎lib/handle/comment.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
2-
* @typedef {import('hast').Comment} Comment
3-
* @typedef {import('hast').Parents} Parents
4-
*
5-
* @typedef {import('../index.js').State} State
2+
* @import {Comment, Parents} from 'hast'
3+
* @import {State} from '../index.js'
64
*/
75

86
import {stringifyEntities} from 'stringify-entities'

‎lib/handle/doctype.js‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
/**
2-
* @typedef {import('hast').Doctype} Doctype
3-
* @typedef {import('hast').Parents} Parents
4-
*
5-
* @typedef {import('../index.js').State} State
2+
* @import {Doctype, Parents} from 'hast'
3+
* @import {State} from '../index.js'
64
*/
75

8-
// Make VS code see references to the above types.
9-
''
10-
116
/**
127
* Serialize a doctype.
138
*

‎lib/handle/element.js‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
* @typedef {import('hast').Parents} Parents
4-
* @typedef {import('hast').Properties} Properties
5-
*
6-
* @typedef {import('../index.js').State} State
2+
* @import {Element, Parents, Properties} from 'hast'
3+
* @import {State} from '../index.js'
74
*/
85

96
import {ccount} from 'ccount'

‎lib/handle/index.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
2-
* @typedef {import('hast').Nodes} Nodes
3-
* @typedef {import('hast').Parents} Parents
4-
*
5-
* @typedef {import('../index.js').State} State
2+
* @import {Nodes, Parents} from 'hast'
3+
* @import {State} from '../index.js'
64
*/
75

86
import {zwitch} from 'zwitch'

‎lib/handle/raw.js‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/**
2-
* @typedef {import('hast').Parents} Parents
3-
*
4-
* @typedef {import('mdast-util-to-hast').Raw} Raw
5-
*
6-
* @typedef {import('../index.js').State} State
2+
* @import {Parents} from 'hast'
3+
* @import {Raw} from 'mdast-util-to-hast'
4+
* @import {State} from '../index.js'
75
*/
86

97
import {text} from './text.js'

‎lib/handle/root.js‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
/**
2-
* @typedef {import('hast').Parents} Parents
3-
* @typedef {import('hast').Root} Root
4-
*
5-
* @typedef {import('../index.js').State} State
2+
* @import {Parents, Root} from 'hast'
3+
* @import {State} from '../index.js'
64
*/
75

8-
// Make VS code see references to the above types.
9-
''
10-
116
/**
127
* Serialize a root.
138
*

‎lib/handle/text.js‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
/**
2-
* @typedef {import('hast').Parents} Parents
3-
* @typedef {import('hast').Text} Text
4-
*
5-
* @typedef {import('mdast-util-to-hast').Raw} Raw
6-
*
7-
* @typedef {import('../index.js').State} State
2+
* @import {Parents, Text} from 'hast'
3+
* @import {Raw} from 'mdast-util-to-hast'
4+
* @import {State} from '../index.js'
85
*/
96

107
import {stringifyEntities} from 'stringify-entities'

‎lib/index.js‎

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/**
2-
* @typedef {import('hast').Nodes} Nodes
3-
* @typedef {import('hast').Parents} Parents
4-
* @typedef {import('hast').RootContent} RootContent
5-
*
6-
* @typedef {import('property-information').Schema} Schema
7-
*
8-
* @typedef {import('stringify-entities').Options} StringifyEntitiesOptions
2+
* @import {Nodes, Parents, RootContent} from 'hast'
3+
* @import {Schema} from 'property-information'
4+
* @import {Options as StringifyEntitiesOptions} from 'stringify-entities'
95
*/
106

117
/**
@@ -77,10 +73,10 @@
7773
* Leave attributes unquoted if that results in less bytes (default: `false`).
7874
*
7975
* Not used in the SVG space.
80-
* @property {Quote | null | undefined} [quote='"']
81-
* Preferred quote to use (default: `'"'`).
8276
* @property {boolean | null | undefined} [quoteSmart=false]
8377
* Use the other quote if that results in less bytes (default: `false`).
78+
* @property {Quote | null | undefined} [quote='"']
79+
* Preferred quote to use (default: `'"'`).
8480
* @property {Space | null | undefined} [space='html']
8581
* When an `<svg>` element is found in the HTML space, this package already
8682
* automatically switches to and from the SVG space when entering and exiting
@@ -138,18 +134,18 @@
138134
*
139135
* @typedef State
140136
* Info passed around about the current state.
141-
* @property {(node: Nodes, index: number | undefined, parent: Parents | undefined) => string} one
142-
* Serialize one node.
143137
* @property {(node: Parents | undefined) => string} all
144138
* Serialize the children of a parent node.
145-
* @property {Settings} settings
146-
* User configuration.
147-
* @property {Schema} schema
148-
* Current schema.
149-
* @property {Quote} quote
150-
* Preferred quote.
151139
* @property {Quote} alternative
152140
* Alternative quote.
141+
* @property {(node: Nodes, index: number | undefined, parent: Parents | undefined) => string} one
142+
* Serialize one node.
143+
* @property {Quote} quote
144+
* Preferred quote.
145+
* @property {Schema} schema
146+
* Current schema.
147+
* @property {Settings} settings
148+
* User configuration.
153149
*/
154150

155151
import {htmlVoidElements} from 'html-void-elements'

‎lib/omission/closing.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
* @typedef {import('hast').Parents} Parents
2+
* @import {Element, Parents} from 'hast'
43
*/
54

65
import {whitespace} from 'hast-util-whitespace'

‎lib/omission/omission.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
* @typedef {import('hast').Parents} Parents
2+
* @import {Element, Parents} from 'hast'
43
*/
54

65
/**

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /