Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit 494505a

Browse files
committed
requireSpaceBeforeKeywords: add specific test for function keyword
Ref #2135
1 parent 3d4e05a commit 494505a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/specs/rules/require-space-before-keywords.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,12 @@ describe('rules/require-space-before-keywords', function() {
129129
checker.checkString('if (typeof value !== "function") {}')
130130
).to.have.no.errors();
131131
});
132+
133+
it('should report `function` keyword if it passed explicitly (#2135)', function() {
134+
checker.configure({ requireSpaceBeforeKeywords: ['function'] });
135+
136+
expect(
137+
checker.checkString('module.exports=function() {}')
138+
).to.have.one.validation.error.from('requireSpaceBeforeKeywords');
139+
});
132140
});

0 commit comments

Comments
 (0)