Skip to content

Commit 732f720

Browse files
committed
Fix: require-meta-type crash when has no meta property
if a rule has no meta property, eslint is reporting: AssertionError [ERR_ASSERTION]: Node must be provided when reporting error if location is not provided
1 parent 8067824 commit 732f720

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/rules/require-meta-type.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = {
4242

4343
return {
4444
Program () {
45-
if (info === null) {
45+
if (info === null || info.meta === null) {
4646
return;
4747
}
4848

tests/lib/rules/require-meta-type.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ ruleTester.run('require-meta-type', rule, {
3737
create(context) {}
3838
};
3939
`,
40+
`module.exports = {
41+
create(context) {}
42+
}`,
4043
],
4144

4245
invalid: [

0 commit comments

Comments
 (0)