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 44coverage /
55node_modules /
66yarn.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 11/**
2- * @typedef {import('unist').Node } Node
2+ * @import {Options} from 'unist-util-inspect'
3+ * @import {Node} from 'unist'
34 */
45
56/**
6- * @typedef Options
7- * Configuration.
8- * @property {boolean | null | undefined } [showPositions=true]
9- * Whether to include positional information (default: `true`).
10- *
117 * @typedef State
128 * Info passed around.
139 * @property {boolean } showPositions
@@ -29,6 +25,7 @@ import {color} from '#conditional-color'
2925/* c8 ignore next */
3026export const inspect = color ? inspectColor : inspectNoColor
3127
28+ // To do: next major (?): use `Object.hasOwn`.
3229const own = { } . hasOwnProperty
3330
3431const bold = ansiColor ( 1 , 22 )
Original file line number Diff line number Diff line change 8686 "strict" : true
8787 },
8888 "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+ ],
89114 "prettier" : true ,
90115 "rules" : {
91116 "unicorn/prefer-string-replace-all" : " off"
Original file line number Diff line number Diff line change 11/**
2- * @typedef { import('nlcst'). Root} NlcstRoot
2+ * @import { Root as NlcstRoot} from 'nlcst'
33 */
44
55import assert from 'node:assert/strict'
Original file line number Diff line number Diff line change 77 "exactOptionalPropertyTypes" : true ,
88 "lib" : [" es2022" ],
99 "module" : " node16" ,
10- // Remove after `retext` update.
11- "skipLibCheck" : true ,
1210 "strict" : true ,
1311 "target" : " es2022"
1412 },
1513 "exclude" : [" coverage/" , " node_modules/" ],
16- "include" : [" **/*.js" ]
14+ "include" : [" **/*.js" , " index.d.ts " ]
1715}
You can’t perform that action at this time.
0 commit comments