# babel-plugin-jsx-remove-attributes

> Babel plugin to remove JSX attributes

Latest version **1.0.0** (published 2022-08-19) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2022-08-19 |
| First published | 2022-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Leonardo Avelino |
| Maintainers | leoavelino7 |
| Keywords | babel, plugin, html, remove-attributes |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-jsx-remove-attributes
- Repository: https://github.com/leoavelino7/babel-plugin-remove-html-attributes
- Homepage: https://github.com/leoavelino7/babel-plugin-remove-html-attributes#readme
- Issues: https://github.com/leoavelino7/babel-plugin-remove-html-attributes/issues
- npm.io page: https://npm.io/package/babel-plugin-jsx-remove-attributes

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-08-19

## README

babel-plugin-jsx-remove-attributes
===========

[![NPM version](https://badgen.net/npm/v/babel-plugin-jsx-remove-attributes)](https://www.npmjs.com/package/babel-plugin-jsx-remove-attributes)
[![NPM Weekly Downloads](https://badgen.net/npm/dw/babel-plugin-jsx-remove-attributes)](https://www.npmjs.com/package/babel-plugin-jsx-remove-attributes)
[![License](https://badgen.net/npm/license/babel-plugin-jsx-remove-attributes)](https://www.npmjs.com/package/babel-plugin-jsx-remove-attributes)

A Babel plugin to remove JSX attributes.

## Install

```bash
yarn add -D babel-plugin-jsx-remove-attributes
```

## Usage

In `.babelrc` add the plugin and inform your list of attributes to be removed. (You can pass Strings or RegExp)

```ts
{
  plugins: [
    ...
    [
      "babel-plugin-jsx-remove-attributes", {
        attributes: ["attribute1", /attribute2/, ...]
      }
    ] 
    ...
  ]
}
```

## Example

**Input JSX Component**

```tsx
  const Component = () => (
    <h1 className="title" data-test-id="title" data-effect-active="true">Hello World!</h1>
  )
```

**Config plugin**

```ts
{
  plugins: [
    ...
    [
      "babel-plugin-jsx-remove-attributes", {
        attributes: ["data-test-id", /data-effect.*/]
      }
    ] 
    ...
  ]
}
```

**Output JSX Component**

```tsx
  const Component = () => (
    <h1 className="title">Hello World!</h1>
  )
```

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