Socket
Book a DemoInstallSign in
Socket

babel-plugin-remove-react-jsx-attribute

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-remove-react-jsx-attribute

``` npm install --save-dev babel-plugin-remove-react-jsx-attribute

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
470
10.33%
Maintainers
2
Weekly downloads
 
Created
Source

babel-plugin-remove-react-jsx-attribute

Installation

npm install --save-dev babel-plugin-remove-react-jsx-attribute

yarn add -D babel-plugin-remove-react-jsx-attribute

Introduction

This is useful to remove jsx attribute which isn't not necessary to transpiling your code. For Instance, You can easily remove 'data-testid' just for testing.

Example

  • input
function Element() {
  return <div className="app" data-testid="custom-element" />;
}
  • output
function Element() {
  return <div className="app" />;
}

Usage

Add plugin to .babelrc or webpack.config.js babel options

plugins: [
  ...
  ["babel-plugin-remove-react-jsx-attribute", { attributes: ["data-testid",  /^(data-)/]}]
]

Keywords

babel

FAQs

Package last updated on 23 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.