Skip to content

Commit

Permalink
Resolves #32
Browse files Browse the repository at this point in the history
  • Loading branch information
brenolf committed Apr 20, 2016
1 parent 0fa90c3 commit 0a5e368
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/dictionaries/jscs.js
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,17 @@ module.exports = {

'requireArrowFunctions': 'prefer-arrow-callback',

'disallowArrowFunctions': {
name: 'no-restricted-syntax',
truthy: function () {
var attrs = this.value || []

attrs.push('ArrowFunctionExpression')

return attrs
}
},

'requireSpaceBeforePostfixUnaryOperators': {
name: 'space-unary-ops',
truthy: [2, { words: true, nonwords: true }]
Expand Down
12 changes: 12 additions & 0 deletions test/dictionaries/jscs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,4 +612,16 @@ describe('jscs', function () {
}
}])
})

it('converts disallowArrowFunctions correctly', function () {
var fn = getFn('disallowArrowFunctions')

var fnBound = getFn('disallowArrowFunctions', [
'A', 'B'
])

expect(fn('CLRF')).to.eql(['ArrowFunctionExpression'])

expect(fnBound('LF')).to.eql(['A', 'B', 'ArrowFunctionExpression'])
})
})

0 comments on commit 0a5e368

Please sign in to comment.