diff --git a/lib/index.js b/lib/index.js index 881ebc7f..cef02788 100644 --- a/lib/index.js +++ b/lib/index.js @@ -94,7 +94,6 @@ */ import {toJsxRuntime} from 'hast-util-to-jsx-runtime' -import PropTypes from 'prop-types' // @ts-expect-error: untyped. import {Fragment, jsx, jsxs} from 'react/jsx-runtime' import remarkParse from 'remark-parse' @@ -299,62 +298,6 @@ export function Markdown(options) { } } -Markdown.propTypes = { - // Core options: - children: PropTypes.string, - // Layout options: - className: PropTypes.string, - // Filter options: - allowElement: PropTypes.func, - allowedElements: PropTypes.arrayOf(PropTypes.string), - disallowedElements: PropTypes.arrayOf(PropTypes.string), - unwrapDisallowed: PropTypes.bool, - // Plugin options: - remarkPlugins: PropTypes.arrayOf( - PropTypes.oneOfType([ - PropTypes.object, - PropTypes.func, - PropTypes.arrayOf( - PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.string, - PropTypes.object, - PropTypes.func, - PropTypes.arrayOf( - // prettier-ignore - // type-coverage:ignore-next-line - PropTypes.any - ) - ]) - ) - ]) - ), - rehypePlugins: PropTypes.arrayOf( - PropTypes.oneOfType([ - PropTypes.object, - PropTypes.func, - PropTypes.arrayOf( - PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.string, - PropTypes.object, - PropTypes.func, - PropTypes.arrayOf( - // prettier-ignore - // type-coverage:ignore-next-line - PropTypes.any - ) - ]) - ) - ]) - ), - // Transform options: - skipHtml: PropTypes.bool, - transformLinkUri: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]), - transformImageUri: PropTypes.func, - components: PropTypes.object -} - /** * Make a URL safe. * diff --git a/test.jsx b/test.jsx index ae6bca61..9489c5ef 100644 --- a/test.jsx +++ b/test.jsx @@ -55,7 +55,6 @@ test('react-markdown', async function (t) { /** @type {unknown} */ let message - console.error = function () {} console.warn = capture // @ts-expect-error: check how the runtime handles invalid `children`. @@ -65,7 +64,6 @@ test('react-markdown', async function (t) { '[react-markdown] Warning: please pass a string as `children` (not: `1`)' ) - console.error = error console.warn = warn /** @@ -82,7 +80,6 @@ test('react-markdown', async function (t) { /** @type {unknown} */ let message - console.error = function () {} console.warn = capture // @ts-expect-error: check how the runtime handles invalid `children`. @@ -92,7 +89,6 @@ test('react-markdown', async function (t) { '[react-markdown] Warning: please pass a string as `children` (not: `true`)' ) - console.error = error console.warn = warn /**