File tree Expand file tree Collapse file tree 3 files changed +27
-6
lines changed Expand file tree Collapse file tree 3 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,8 @@ const schema = [{
141
141
enum : [
142
142
'always' ,
143
143
'never'
144
- ]
144
+ ] ,
145
+ default : undefined
145
146
}
146
147
}
147
148
} ] ;
Original file line number Diff line number Diff line change @@ -3,11 +3,15 @@ const {visitIf} = require('enhance-visitors');
3
3
const util = require ( '../util' ) ;
4
4
const createAvaRule = require ( '../create-ava-rule' ) ;
5
5
6
+ const MAX_ASSERTIONS_DEFAULT = 5 ;
7
+
6
8
const notAssertionMethods = [ 'plan' , 'end' ] ;
7
9
8
10
const create = context => {
9
11
const ava = createAvaRule ( ) ;
10
- const maxAssertions = context . options [ 0 ] || 5 ;
12
+ // TODO: Convert options to object JSON Schema default works properly
13
+ // https://github.com/avajs/eslint-plugin-ava/issues/260
14
+ const maxAssertions = context . options [ 0 ] || MAX_ASSERTIONS_DEFAULT ;
11
15
let assertionCount = 0 ;
12
16
let nodeToReport ;
13
17
@@ -55,9 +59,12 @@ const create = context => {
55
59
} ) ;
56
60
} ;
57
61
58
- const schema = [ {
59
- type : 'integer'
60
- } ] ;
62
+ const schema = [
63
+ {
64
+ type : 'integer' ,
65
+ default : MAX_ASSERTIONS_DEFAULT
66
+ }
67
+ ] ;
61
68
62
69
module . exports = {
63
70
create,
Original file line number Diff line number Diff line change @@ -35,12 +35,25 @@ const create = context => {
35
35
} ) ;
36
36
} ;
37
37
38
+ const schema = [
39
+ {
40
+ type : 'object' ,
41
+ properties : {
42
+ format : {
43
+ type : 'string' ,
44
+ default : undefined
45
+ }
46
+ }
47
+ }
48
+ ] ;
49
+
38
50
module . exports = {
39
51
create,
40
52
meta : {
41
53
type : 'suggestion' ,
42
54
docs : {
43
55
url : util . getDocsUrl ( __filename )
44
- }
56
+ } ,
57
+ schema
45
58
}
46
59
} ;
You can’t perform that action at this time.
0 commit comments