Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
babel-plugin-apply-mdx-type-prop
Advanced tools
Apply the MDX type prop used in the MDX pragma
babel-plugin-apply-mdx-type-prop
Babel plugin that applies the mdxType
prop which is
used by the MDX pragma.
It also stores all components encountered as names
in
the plugin state.
yarn add babel-plugin-apply-mdx-type-prop
const babel = require('@babel/core')
const BabelPluginApplyMdxTypeProp = require('babel-plugin-apply-mdx-type-prop')
const jsx = `
export const Foo = () => (
<div>
<Button />
</div>
)
export default () => (
<>
<h1>Hello!</h1>
<TomatoBox />
</>
)
`
const plugin = new BabelPluginApplyMdxTypeProp()
const result = babel.transform(jsx, {
configFile: false,
plugins: ['@babel/plugin-syntax-jsx', plugin.plugin]
})
console.log(result.code)
console.log(plugin.state.names)
export const Foo = () => (
<div>
<Button />
</div>
)
export default () => (
<>
<h1>Hello!</h1>
<TomatoBox />
</>
)
export const Foo = () => (
<div>
<Button mdxType="Button" />
</div>
)
export default () => (
<>
<h1>Hello!</h1>
<TomatoBox mdxType="Button" />
</>
)
MIT
FAQs
Apply the MDX type prop used in the MDX pragma
The npm package babel-plugin-apply-mdx-type-prop receives a total of 1,081,274 weekly downloads. As such, babel-plugin-apply-mdx-type-prop popularity was classified as popular.
We found that babel-plugin-apply-mdx-type-prop demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.