@lwc/babel-plugin-component
Advanced tools
Comparing version 0.36.1 to 0.37.0
{ | ||
"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() |
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
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
98720
2925
+ Added@lwc/errors@0.37.0(transitive)
- Removed@lwc/errors@0.36.1(transitive)
Updated@lwc/errors@0.37.0