@emotion/babel-plugin-jsx-pragmatic
Advanced tools
Comparing version 0.1.5 to 0.2.0
{ | ||
"name": "@emotion/babel-plugin-jsx-pragmatic", | ||
"version": "0.1.5", | ||
"version": "0.2.0", | ||
"description": "Insert code to load a module corresponding to JSX pragma.", | ||
"main": "dist/babel-plugin-jsx-pragmatic.cjs.js", | ||
"module": "dist/babel-plugin-jsx-pragmatic.esm.js", | ||
"main": "dist/emotion-babel-plugin-jsx-pragmatic.cjs.js", | ||
"module": "dist/emotion-babel-plugin-jsx-pragmatic.esm.js", | ||
"exports": { | ||
".": { | ||
"module": "./dist/emotion-babel-plugin-jsx-pragmatic.esm.js", | ||
"default": "./dist/emotion-babel-plugin-jsx-pragmatic.cjs.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"license": "MIT", | ||
"repository": "https://github.com/emotion-js/emotion/tree/master/packages/babel-plugin-jsx-pragmatic", | ||
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/babel-plugin-jsx-pragmatic", | ||
"scripts": { | ||
"test:typescript": "exit 0" | ||
}, | ||
"dependencies": { | ||
"@babel/plugin-syntax-jsx": "^7.2.0" | ||
"@babel/plugin-syntax-jsx": "^7.17.12" | ||
}, | ||
@@ -23,4 +33,4 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@babel/core": "^7.5.5" | ||
"@babel/core": "^7.18.5" | ||
} | ||
} |
@@ -9,3 +9,3 @@ # @emotion/babel-plugin-jsx-pragmatic | ||
[@babel/plugin-transform-react-jsx](https://babeljs.io/docs/en/next/babel-plugin-transform-react-jsx.html) has a `pragma` option that's used when transforming JSX to function calls instead of the default function `React.createElement`. | ||
[@babel/plugin-transform-react-jsx](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx.html) has a `pragma` option that's used when transforming JSX to function calls instead of the default function `React.createElement`. | ||
@@ -31,6 +31,6 @@ This Babel plugin is a companion to that feature that allows you to dynamically load a module associated with the `pragma` value. | ||
```js | ||
babel.transform(code, { | ||
babel.transformSync(code, { | ||
plugins: [ | ||
[ | ||
'babel-plugin-transform-react-jsx', | ||
'@babel/plugin-transform-react-jsx', | ||
{ | ||
@@ -61,6 +61,6 @@ pragma: 'whatever' | ||
```js | ||
babel.transform(code, { | ||
babel.transformSync(code, { | ||
plugins: [ | ||
[ | ||
'babel-plugin-transform-react-jsx', | ||
'@babel/plugin-transform-react-jsx', | ||
{ | ||
@@ -102,3 +102,3 @@ pragma: 'whatever' | ||
[ | ||
'babel-plugin-transform-react-jsx', | ||
'@babel/plugin-transform-react-jsx', | ||
{ | ||
@@ -122,3 +122,3 @@ pragma: 'x' | ||
[ | ||
'babel-plugin-transform-react-jsx', | ||
'@babel/plugin-transform-react-jsx', | ||
{ | ||
@@ -125,0 +125,0 @@ pragma: 'x.y' |
@@ -37,3 +37,3 @@ import syntaxJsx from '@babel/plugin-syntax-jsx' | ||
inherits: syntaxJsx, | ||
pre: function() { | ||
pre: function () { | ||
if (!(this.opts.module && this.opts.import)) { | ||
@@ -47,3 +47,3 @@ throw new Error( | ||
Program: { | ||
exit: function(path, state) { | ||
exit: function (path, state) { | ||
if (!state.get('jsxDetected')) return | ||
@@ -54,6 +54,6 @@ addPragmaImport(path, state) | ||
JSXElement: function(path, state) { | ||
JSXElement: function (path, state) { | ||
state.set('jsxDetected', true) | ||
}, | ||
JSXFragment: function(path, state) { | ||
JSXFragment: function (path, state) { | ||
state.set('jsxDetected', true) | ||
@@ -60,0 +60,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
205
12075
8
1