Skip to content

Commit 4c02274

Browse files
authored
Merge pull request #3 from compwright/patch-1
Fix TypeError: Cannot read property 'startsWith' of undefined
2 parents 2c05a9b + db606dd commit 4c02274

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ function componentSourceNameCheck(context, node) {
161161

162162
function componentSourceDescriptionCheck(context, node) {
163163
const nameProp = checkComponentIsSourceAndReturnTargetProp(node, "description");
164-
if (!nameProp) return;
165-
if (!nameProp?.value?.value.startsWith("Emit new ")) {
164+
if (!nameProp || typeof nameProp?.value?.value !== 'string') return;
165+
if (!nameProp.value.value.startsWith("Emit new ")) {
166166
context.report({
167167
node: nameProp,
168168
message: "Source descriptions should start with \"Emit new\". See https://pipedream.com/docs/components/guidelines/#source-description",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-pipedream",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"description": "ESLint plugin for Pipedream components: https://pipedream.com/docs/components/api/",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)