babel-plugin-remove-object-properties

Babel plugin for removing object properties

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
babel-plugin-remove-object-properties
1.0.26 years ago6 years agoMinified + gzip package size for babel-plugin-remove-object-properties in KB

Readme

Babel Plugin for Removing Object Properties
Removes nodes in the AST (abstract syntax tree) that match a supplied regex if the node is of type ObjectProperty.

Why?

For testing, we want to add attributes to react elements like:
<div
    data-id="test">
</div>
We wanted a plugin that would then strip these attributes during the transpilation phase.

Installation

$ npm install babel-plugin-remove-object-properties

Usage

Via .babelrc (Recommended)

.babelrc
{
  "plugins": [["remove-object-properties", { "regexp": "data-*" }]]
}