Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-react-jsx-source

Package Overview
Dependencies
Maintainers
4
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-react-jsx-source

Add a __source prop to all JSX Elements

  • 7.0.0-alpha.17
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
315K
decreased by-45.12%
Maintainers
4
Weekly downloads
 
Created

What is babel-plugin-transform-react-jsx-source?

The babel-plugin-transform-react-jsx-source package is a Babel plugin that adds source file and line number information to JSX elements. This is particularly useful for debugging purposes, as it allows developers to trace back to the original source code location of a JSX element.

What are babel-plugin-transform-react-jsx-source's main functionalities?

Add source file and line number information

This feature automatically adds metadata to JSX elements, indicating the source file and line number where the element was defined. This is extremely helpful for debugging, as it allows developers to quickly locate the source of a JSX element in their codebase.


// Input JSX code
const element = <div>Hello, world!</div>;

// Transformed code with babel-plugin-transform-react-jsx-source
const element = <div __source={{ fileName: 'path/to/file.js', lineNumber: 1 }}>Hello, world!</div>;

Other packages similar to babel-plugin-transform-react-jsx-source

Keywords

FAQs

Package last updated on 26 Jul 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc