Socket
Socket
Sign inDemoInstall

babel-plugin-emotion-rename

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-emotion-rename - npm Package Compare versions

Comparing version 1.0.0-beta.20 to 1.0.0-beta.21

17

lib/index.js

@@ -14,3 +14,3 @@ "use strict";

function getStyled(path) {
if (path.node.source.value !== "react-emotion") {
if (path.node.source.value !== "react-emotion" && path.node.source.value !== "emotion") {
return {

@@ -164,3 +164,3 @@ hasStyled: [],

path.node.source = t.stringLiteral("@emotion/css");
} else if (importPackageName === "react-emotion") {
} else if (importPackageName === "react-emotion" || importPackageName == "emotion") {
var _path$node$specifiers, _path$node$specifiers2, _styledDefaultNode$lo;

@@ -267,7 +267,12 @@ var cssLocalName = (_path$node$specifiers = path.node.specifiers.find(function (s) {

*/
if (path.scope.bindings.styled && /(react-)?emotion/.test(node.arguments[0].value)) {
path.node.arguments = [t.stringLiteral("@emotion/styled")];
return;
}
// if (
// path.scope.bindings.styled &&
// /(react-)?emotion/.test(node.arguments[0].value)
// ) {
// path.node.arguments = [t.stringLiteral("@emotion/styled")];
// return;
// }
path.node.arguments = [t.stringLiteral("@emotion/css")];
// path.node.arguments = [

@@ -274,0 +279,0 @@ // source(node.arguments[0].value, original, replacement),

{
"name": "babel-plugin-emotion-rename",
"version": "1.0.0-beta.20",
"version": "1.0.0-beta.21",
"description": "Babel plugin to rename old Emotion 9 import to new Emotion 10+ import",

@@ -5,0 +5,0 @@ "main": "lib/index",

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