Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/__tests__/setup-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ function copyProps(src, target) {
// @ts-expect-error TS2322 🤷‍♂️
global.window = window
global.document = window.document
// @ts-expect-error TS2740 🤷‍♂️
global.navigator = {userAgent: 'node.js'}
// Use Object.defineProperty to set navigator because in Node 21+ it's read-only
Object.defineProperty(global, 'navigator', {
value: {userAgent: 'node.js'},
writable: true,
configurable: true,
})
global.requestAnimationFrame = callback => setTimeout(callback, 0)
global.cancelAnimationFrame = id => clearTimeout(id)
copyProps(window, global)
6 changes: 6 additions & 0 deletions src/remark-mdx-images.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Type declaration override for remark-mdx-images to fix type compatibility issues
declare module 'remark-mdx-images' {
import type {Plugin} from 'unified'
const remarkMdxImages: Plugin
export default remarkMdxImages
}
8 changes: 6 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"checkJs": true,
"lib": [
"ES2021.String"
]
}
],
"skipLibCheck": true
},
"exclude": [
"node_modules"
]
}