diff --git a/lib/complex-types.d.ts b/lib/complex-types.d.ts index 8ae2cdb..ee73971 100644 --- a/lib/complex-types.d.ts +++ b/lib/complex-types.d.ts @@ -1,4 +1,4 @@ -import type {Node, Parent} from 'unist' +import type {Node} from 'unist' type MatchesOne = // Is this a node? diff --git a/lib/index.js b/lib/index.js index 9445033..cf88432 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,13 @@ /** * @typedef {import('unist').Node} Node * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test + * + * @typedef {Exclude | undefined} Test + * Test from `unist-util-is`. + * + * Note: we have remove and add `undefined`, because otherwise when generating + * automatic `.d.ts` files, TS tries to flatten paths from a local perspective, + * which doesn’t work when publishing on npm. */ /** diff --git a/package.json b/package.json index d20f4f7..fea1037 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "unist-util-filter", - "version": "5.0.0", + "version": "5.0.1", "description": "unist utility to create a new tree with nodes that pass a filter", "license": "MIT", "keywords": [ @@ -41,19 +41,19 @@ "@types/mdast": "^4.0.0", "@types/node": "^20.0.0", "c8": "^8.0.0", - "prettier": "^2.0.0", + "prettier": "^3.0.0", "remark-cli": "^11.0.0", "remark-preset-wooorm": "^9.0.0", "tsd": "^0.28.0", "type-coverage": "^2.0.0", "typescript": "^5.0.0", "unist-builder": "^4.0.0", - "xo": "^0.54.0" + "xo": "^0.56.0" }, "scripts": { "prepack": "npm run build && npm run format", "build": "tsc --build --clean && tsc --build && tsd && type-coverage", - "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", "test-api": "node --conditions development test.js", "test-coverage": "c8 --100 --reporter lcov npm run test-api", "test": "npm run build && npm run format && npm run test-coverage"