# babel-plugin-remove-data-test-id-attribute

> removes data-test-id attributes from jsx html elements. To be used for production builds.

Latest version **1.0.0** (published 2018-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-remove-data-test-id-attribute
pnpm add babel-plugin-remove-data-test-id-attribute
yarn add babel-plugin-remove-data-test-id-attribute
bun add babel-plugin-remove-data-test-id-attribute
```

## 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 | 2018-04-22 |
| First published | 2018-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Mukesh Soni |
| Maintainers | mukeshsoni |
| Keywords | babel-plugin, babel, transformation, jsx |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-remove-data-test-id-attribute
- Repository: https://github.com/mukeshsoni/babel-plugin-remove-data-test-id-attribute
- Homepage: https://github.com/mukeshsoni/babel-plugin-remove-data-test-id-attribute#readme
- Issues: https://github.com/mukeshsoni/babel-plugin-remove-data-test-id-attribute/issues
- npm.io page: https://npm.io/package/babel-plugin-remove-data-test-id-attribute

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-04-22

## README

# babel-plugin-remove-data-test-id-attribute

Removes `data-test-id` attribute from jsx html elements.

The `data-test-id` is normally added for testing as a helper attribute to quickly grab an element by id and simualte events or do other stuff. The `data-test-id` not required in the production builds and should be removed in production builds.

Usage -

```
$ npm i -D babel-plugin-remove-data-test-id-attribute
```

In your .babelrc file, or whereever you setup babel preferences, add the plugin to the plugins array, inside the production environment -

```
{
    "env": {
    "production": {
      "plugins": ["babel-plugin-remove-data-test-id-attribute" ]
    }
  }
}
```

E.g. - If your jsx code looks like this

```
<div data-id="pqr" data-test-id='abc'>
    abc
	<p>para</p>
    <Custom data-test-id='blah' />
</div>
```

When the code is passed through this plugin, it will change to -

```
<div data-id="pqr">
    abc
	<p>para</p>
    <Custom />
</div>
```

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