File tree Expand file tree Collapse file tree 7 files changed +50
-18
lines changed Expand file tree Collapse file tree 7 files changed +50
-18
lines changed Original file line number Diff line number Diff line change 4
4
coverage /
5
5
node_modules /
6
6
yarn.lock
7
+ ! /index.d.ts
Original file line number Diff line number Diff line change
1
+ export { inspectColor , inspectNoColor , inspect } from './lib/index.js'
2
+
3
+ // To do: next major: remove.
4
+ /**
5
+ * Deprecated, use `Options`.
6
+ */
7
+ export type InspectOptions = Options
8
+
9
+ /**
10
+ * Configuration.
11
+ */
12
+ export interface Options {
13
+ /**
14
+ * Whether to include positional information (default: `true`).
15
+ */
16
+ showPositions ?: boolean | null | undefined
17
+ }
Original file line number Diff line number Diff line change 1
- /**
2
- * @typedef {import('./lib/index.js').Options } Options
3
- *
4
- * @typedef {Options } InspectOptions
5
- * Deprecated, use `Options`.
6
- */
7
-
8
- export { inspect , inspectColor , inspectNoColor } from './lib/index.js'
1
+ // Note: types exposed from `index.d.ts`.
2
+ export { inspectColor , inspectNoColor , inspect } from './lib/index.js'
Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef {import('unist').Node } Node
2
+ * @import {Options} from 'unist-util-inspect'
3
+ * @import {Node} from 'unist'
3
4
*/
4
5
5
6
/**
6
- * @typedef Options
7
- * Configuration.
8
- * @property {boolean | null | undefined } [showPositions=true]
9
- * Whether to include positional information (default: `true`).
10
- *
11
7
* @typedef State
12
8
* Info passed around.
13
9
* @property {boolean } showPositions
@@ -29,6 +25,7 @@ import {color} from '#conditional-color'
29
25
/* c8 ignore next */
30
26
export const inspect = color ? inspectColor : inspectNoColor
31
27
28
+ // To do: next major (?): use `Object.hasOwn`.
32
29
const own = { } . hasOwnProperty
33
30
34
31
const bold = ansiColor ( 1 , 22 )
Original file line number Diff line number Diff line change 86
86
"strict" : true
87
87
},
88
88
"xo" : {
89
+ "overrides" : [
90
+ {
91
+ "files" : [
92
+ " **/*.d.ts"
93
+ ],
94
+ "rules" : {
95
+ "@typescript-eslint/array-type" : [
96
+ " error" ,
97
+ {
98
+ "default" : " generic"
99
+ }
100
+ ],
101
+ "@typescript-eslint/ban-types" : [
102
+ " error" ,
103
+ {
104
+ "extendDefaults" : true
105
+ }
106
+ ],
107
+ "@typescript-eslint/consistent-type-definitions" : [
108
+ " error" ,
109
+ " interface"
110
+ ]
111
+ }
112
+ }
113
+ ],
89
114
"prettier" : true ,
90
115
"rules" : {
91
116
"unicorn/prefer-string-replace-all" : " off"
Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef { import('nlcst'). Root} NlcstRoot
2
+ * @import { Root as NlcstRoot} from 'nlcst'
3
3
*/
4
4
5
5
import assert from 'node:assert/strict'
Original file line number Diff line number Diff line change 7
7
"exactOptionalPropertyTypes" : true ,
8
8
"lib" : [" es2022" ],
9
9
"module" : " node16" ,
10
- // Remove after `retext` update.
11
- "skipLibCheck" : true ,
12
10
"strict" : true ,
13
11
"target" : " es2022"
14
12
},
15
13
"exclude" : [" coverage/" , " node_modules/" ],
16
- "include" : [" **/*.js" ]
14
+ "include" : [" **/*.js" , " index.d.ts " ]
17
15
}
You can’t perform that action at this time.
0 commit comments