Skip to content

Commit

Permalink
Remove prop-types
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 27, 2023
1 parent 1349189 commit e12b5e9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
57 changes: 0 additions & 57 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
*
Expand Down
4 changes: 0 additions & 4 deletions test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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

/**
Expand All @@ -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`.
Expand All @@ -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

/**
Expand Down

0 comments on commit e12b5e9

Please sign in to comment.