Skip to content

Commit

Permalink
Add max-statements rule
Browse files Browse the repository at this point in the history
  • Loading branch information
wyze committed May 9, 2016
1 parent f35f830 commit 673b9f4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions base.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
'plugin:wyze/recommended',
'wyze/rules/best-practices',
'wyze/rules/es6',
'wyze/rules/legacy',
'wyze/rules/style'
],
parser: 'babel-eslint',
Expand Down
6 changes: 6 additions & 0 deletions rules/legacy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
'rules': {
// specify the maximum number of statement allowed in a function
'max-statements': [2, 20]
}
}
3 changes: 2 additions & 1 deletion test/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import base from '../base'
import test from 'ava'

test('extends length', async t => {
const expected = 5
const expected = 6

t.is(base.extends.length, expected, 'Incorrect number of rulesets')
})
Expand All @@ -13,6 +13,7 @@ test('extends files', async t => {
'plugin:wyze/recommended',
'wyze/rules/best-practices',
'wyze/rules/es6',
'wyze/rules/legacy',
'wyze/rules/style',
]

Expand Down
8 changes: 8 additions & 0 deletions test/rules/legacy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { rules } from '../../rules/legacy'
import test from 'ava'

test('no react rules', async t => {
Object.keys(rules).forEach(rule => {
t.falsy(~rule.indexOf('react/'), 'found react rule in undesired file')
})
})

0 comments on commit 673b9f4

Please sign in to comment.