Skip to content

Commit dbbe7f7

Browse files
committed
Refactor code-style
1 parent b52b6ee commit dbbe7f7

File tree

3 files changed

+402
-351
lines changed

3 files changed

+402
-351
lines changed

lib/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/**
22
* @typedef {import('unist').Node} Node
3-
*
3+
*/
4+
5+
/**
46
* @typedef Options
57
* Configuration.
68
* @property {boolean | null | undefined} [showPositions=true]
7-
* Whether to include positional information.
9+
* Whether to include positional information (default: `true`).
810
*
911
* @typedef State
1012
* Info passed around.
@@ -20,7 +22,7 @@ import {color} from './color.js'
2022
* @param tree
2123
* Tree to inspect.
2224
* @param options
23-
* Configuration.
25+
* Configuration (optional).
2426
* @returns
2527
* Pretty printed `tree`.
2628
*/
@@ -60,7 +62,7 @@ export function inspectNoColor(tree, options) {
6062
* @param {unknown} tree
6163
* Tree to inspect.
6264
* @param {Options | null | undefined} [options]
63-
* Configuration.
65+
* Configuration (optional).
6466
* @returns {string}
6567
* Pretty printed `tree`.
6668
*/
@@ -284,7 +286,7 @@ function formatNode(node, state) {
284286
* @param {string} indentation
285287
* Indent to use.
286288
* @param {boolean | undefined} [ignoreFirst=false]
287-
* Whether to ignore indenting the first line.
289+
* Whether to ignore indenting the first line (default: `false`).
288290
* @returns {string}
289291
* Indented `value`.
290292
*/
@@ -304,7 +306,7 @@ function indent(value, indentation, ignoreFirst) {
304306
/**
305307
* Serialize a position.
306308
*
307-
* @param {unknown | null | undefined} [value]
309+
* @param {unknown} [value]
308310
* Position to serialize.
309311
* @returns {string}
310312
* Serialized position.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"@types/unist": "^2.0.0"
4343
},
4444
"devDependencies": {
45+
"@types/nlcst": "^1.0.0",
4546
"@types/node": "^20.0.0",
4647
"c8": "^8.0.0",
4748
"chalk": "^5.0.0",

0 commit comments

Comments
 (0)