Skip to content

Commit 02b9b88

Browse files
committed
fix(func-style): allow fat arrow declaration
Fix #22
1 parent 4a898b0 commit 02b9b88

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ module.exports = {
119119
'func-style': [
120120
ERROR,
121121
'declaration',
122+
{ allowArrowFunctions: true },
122123
],
123124
'global-require': ERROR,
124125
'guard-for-in': ERROR,

test/validate.mocha.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-env node, mocha */
2-
/* eslint no-magic-numbers:0 */
2+
/* eslint no-magic-numbers:0 no-template-curly-in-string:0 */
33
'use strict';
44

55
const eslint = require('eslint');
@@ -36,6 +36,13 @@ describe('load config in eslint to check syntax', () => {
3636
assertCode(code);
3737
});
3838

39+
it('should allow to declare function with fat arrows', () => {
40+
const code = 'const hello = name => `hello ${name}`;\n\n' +
41+
'hello(\'seb\');\n';
42+
43+
assertCode(code);
44+
});
45+
3946
it('should disallow .only on describe', () => {
4047
const code = `
4148
var describe;

0 commit comments

Comments
 (0)