JSPM

babel-plugin-remove-attribute

0.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 983
  • Score
    100M100P100Q107987F
  • License MIT

Plugin to remove a single attribute from JSX

Package Exports

  • babel-plugin-remove-attribute

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-plugin-remove-attribute) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

babel-plugin-remove-attribute CircleCI

Plugin to remove a single attribute from JSX.

Usage (.babelrc)

{
  plugins: [
    ..., 
    ['babel-plugin-remove-attribute', { 
      attribute: (attribute name here),
    }], 
    ...,
  ],
}

Motivation

When locating elements for testing (e.g. React, Selenium), it's common to do this via a class on the element. This couples styling with testing, which is something you don't want, so you probably use a custom attribute on the elements. You likely also don't want your production code riddled with these attributes either.