# babel-plugin-jsx-attrs

> Babel plugin which transforms attributes in JSX.

Latest version **1.0.0** (published 2017-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-jsx-attrs
pnpm add babel-plugin-jsx-attrs
yarn add babel-plugin-jsx-attrs
bun add babel-plugin-jsx-attrs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-07-26 |
| First published | 2017-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | xingtan |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-jsx-attrs
- Repository: https://github.com/ChaofengYan/babel-plugin-jsx-attrs
- Homepage: https://github.com/ChaofengYan/babel-plugin-jsx-attrs#readme
- Issues: https://github.com/ChaofengYan/babel-plugin-jsx-attrs/issues
- npm.io page: https://npm.io/package/babel-plugin-jsx-attrs

## Recent versions

- 1.0.0 (latest) — 2017-07-26

## README

# babel-plugin-jsx-attrs

[![Travis][travis-badge]][travis]
[![npm package][npm-badge]][npm]

Transforms JSX any attributes according to specified rules .

## Example

Converts

```javascript
<div id="test" class="test">
  <label for="test">Test</label>
</div>
```

(roughly) to

```javascript
<div id="test" className="prefix-test">
  <label htmlFor="test">Test</label>
</div>;
```

## Installation & Usage

Install the plugin:

```
npm install --save-dev babel-plugin-jsx-attrs
```

Then edit your `.babelrc` to include `jsx-attrs`:

```json
{
  "plugins": [["jsx-attrs",options]]
}
```

### options

`options` must be object.

```javascript
{
  "for":"htmlFor"  // replace attribute name only
}
```

```javascript
{
  "class":{       // replace attribute name & value
    "name":"className",
    "value":"prefix-{value}"   //  "{value}" will be replaced by the real value
  }
}
```

---
_Source: https://npm.io/package/babel-plugin-jsx-attrs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
