jsx-autocorrect
v1.0.0
Published
A babel plugin that replaces html attributes with their jsx counterparts
Downloads
23
Readme
jsx-autocorrect
A babel plugin that enables you to use class
, for
, and enable-background
as jsx attributes. Go nuts!
Example
<input class="camouflage" name="cuttlefish" ... />
<label for="cuttlefish">
<svg viewBox="0 0 25 25" enable-background="new 0 0 25 25">
...
Transpiled:
<input className="camouflage" name="cuttlefish" ... />
<label htmlFor="cuttlefish">
<svg viewBox="0 0 25 25" enableBackground="new 0 0 25 25">
...
Install
npm install --save-dev jsx-autocorrect
with .babelrc:
{
"presets": ["es2015", "react"],
"plugins": ["jsx-autocorrect"]
}
with webpack
module.exports = {
module: {
loaders: [
{
test: /\.jsx$/,
loader: 'babel',
query: {
plugins: ['jsx-autocorrect'],
},
},
],
},
...
}
Feel free to suggest any additions!