babel-plugin-html-attributes-to-jsx
Coerce HTML attributes into something JSX and React friendly
Last updated 2 months ago by johno .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install babel-plugin-html-attributes-to-jsx 
SYNC missed versions from official npm registry.

babel-plugin-html-attributes-to-jsx

Coerce HTML attributes into something JSX and React friendly. Used by MDX.

Installation

yarn add babel-plugin-html-attributes-to-jsx

Usage

const babel = require('@babel/core')

const plugin = require('babel-plugin-html-attributes-to-jsx')

const jsx = `
export const Foo = () => (
  <div srcset="foo">
    <Button />
  </div>
)
`

const plugin = new BabelPluginHtmlAttributesToJsx()

const result = babel.transform(jsx, {
  configFile: false,
  plugins: ['@babel/plugin-syntax-jsx', plugin]
})

console.log(result.code)

Input

export const Foo = () => (
  <div srcset="foo">
    <Button />
  </div>
)

Output

const Foo = () => (
  <div srcSet="foo">
    <Button />
  </div>
)

License

MIT

Current Tags

  • 1.6.13-ci.1                                ...           ci (6 months ago)
  • 1.6.22                                ...           latest (2 months ago)
  • 2.0.0-next.8                                ...           next (4 months ago)

55 Versions

  • 1.6.22                                ...           2 months ago
  • 1.6.21                                ...           3 months ago
  • 1.6.20                                ...           3 months ago
  • 1.6.19                                ...           3 months ago
  • 2.0.0-next.8                                ...           4 months ago
  • 1.6.18                                ...           4 months ago
  • 1.6.17                                ...           4 months ago
  • 2.0.0-next.7                                ...           6 months ago
  • 1.6.16                                ...           6 months ago
  • 1.6.15                                ...           6 months ago
  • 2.0.0-next.6                                ...           6 months ago
  • 2.0.0-next.5                                ...           6 months ago
  • 1.6.14                                ...           6 months ago
  • 2.0.0-next.4                                ...           6 months ago
  • 1.6.13-ci.1                                ...           6 months ago
  • 1.6.13                                ...           6 months ago
  • 1.6.12-ci.2                                ...           6 months ago
  • 1.6.12                                ...           6 months ago
  • 2.0.0-next.3                                ...           6 months ago
  • 1.6.11                                ...           6 months ago
  • 1.6.10                                ...           6 months ago
  • 1.6.9                                ...           6 months ago
  • 1.6.8                                ...           6 months ago
  • 1.6.8-ci.4                                ...           6 months ago
  • 1.6.7                                ...           6 months ago
  • 1.6.6                                ...           7 months ago
  • 1.6.5                                ...           8 months ago
  • 2.0.0-next.1                                ...           8 months ago
  • 1.6.4                                ...           8 months ago
  • 1.6.3                                ...           8 months ago
  • 1.6.2                                ...           8 months ago
  • 1.6.1                                ...           9 months ago
  • 1.6.0                                ...           9 months ago
  • 1.5.9                                ...           9 months ago
  • 1.5.9-ci.5                                ...           9 months ago
  • 1.5.8                                ...           10 months ago
  • 1.5.8-ci.13                                ...           10 months ago
  • 1.5.8-alpha.0                                ...           a year ago
  • 1.5.7                                ...           a year ago
  • 1.5.7-alpha.0                                ...           a year ago
  • 1.5.6                                ...           a year ago
  • 1.5.6-alpha.0                                ...           a year ago
  • 1.5.6-ci.0                                ...           a year ago
  • 1.5.5                                ...           a year ago
  • 1.5.4                                ...           a year ago
  • 1.5.3                                ...           a year ago
  • 1.5.2                                ...           a year ago
  • 1.5.1                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.5                                ...           a year ago
  • 1.4.4                                ...           a year ago
  • 1.4.3                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 11
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |