Skip to content

Commit bc9b1a0

Browse files
aladdin-addnot-an-aardvark
authored andcommitted
Fix: require-meta-type crash when has no meta property (#73)
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 bc9b1a0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/rules/require-meta-type.js

+1-1
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

+3
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)