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

@lwc/babel-plugin-component

Package Overview
Dependencies
Maintainers
11
Versions
784
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lwc/babel-plugin-component - npm Package Compare versions

Comparing version 0.36.1 to 0.37.0

6

package.json
{
"name": "@lwc/babel-plugin-component",
"description": "Babel plugin to transform a LWC module",
"version": "0.36.1",
"version": "0.37.0",
"main": "src/index.js",

@@ -14,3 +14,3 @@ "typings": "types/index.d.ts",

"@babel/plugin-proposal-class-properties": "7.1.0",
"@lwc/errors": "0.36.1"
"@lwc/errors": "0.37.0"
},

@@ -23,3 +23,3 @@ "devDependencies": {

},
"gitHead": "7a4c15dc532f0695556f28580b2f7c5a16546214"
"gitHead": "fe3206c9f33e7d7badc7789041e7befe98a19437"
}

@@ -105,2 +105,20 @@ /*

pluginTest(
'decorator expects wire adapter to be imported',
`
import { LightningElement, wire } from 'lwc';
export default class PublicMethods extends LightningElement {
@wire(adapter) foo;
}
`,
{
error: {
message: 'Failed to resolve @wire adapter "adapter". Ensure it is imported',
loc: {
line: 2,
column: 4,
},
},
}
);
pluginTest(
'decorator expects wire adapter as first parameter',

@@ -107,0 +125,0 @@ `

@@ -23,3 +23,5 @@ /*

if (!id.isIdentifier()) {
const isIdentifier = id.isIdentifier();
if (!isIdentifier) {
throw generateError(id, {

@@ -30,4 +32,13 @@ errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER,

// ensure wire adapter is imported
if (isIdentifier && !path.scope.getBinding(id.node.name)) {
throw generateError(id, {
errorInfo: DecoratorErrors.WIRE_ADAPTER_SHOULD_BE_IMPORTED,
messageArgs: [id.node.name],
});
}
// ensure wire adapter is a first parameter
if (
id.isIdentifier() &&
isIdentifier &&
!path.scope.getBinding(id.node.name).path.isImportSpecifier() &&

@@ -34,0 +45,0 @@ !path.scope.getBinding(id.node.name).path.isImportDefaultSpecifier()

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