Skip to content

Commit dbf641c

Browse files
committed
2 parents b12a66d + 8064488 commit dbf641c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/rules/entry-points.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
let hasValidEntryPoint = false;
1616
let scriptType = getScriptType(context);
1717

18-
if (!scriptType.value || !scriptType.def) {
18+
if (!scriptType || !scriptType.value || !scriptType.def) {
1919
return;
2020
}
2121

tests/rules/entry-points.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ define([], function() {
101101
});
102102
`,
103103
},
104+
{
105+
code: `
106+
// no @NScriptType comment
107+
108+
define([], function() {
109+
return { foo: 'bar' };
110+
});
111+
`,
112+
// Should not error, since scriptType is null and rule should exit early
113+
},
104114
],
105115

106116
invalid: [

0 commit comments

Comments
 (0)