Skip to content

Commit 5008fcf

Browse files
committed
fix: make options schemas effective
1 parent da25e1b commit 5008fcf

File tree

6 files changed

+94
-93
lines changed

6 files changed

+94
-93
lines changed

src/rules/newlineAfterDescription.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ export default iterateJsdoc(({
5656
}, {
5757
meta: {
5858
fixable: 'whitespace',
59+
schema: [
60+
{
61+
enum: ['always', 'never'],
62+
type: 'string'
63+
}
64+
],
5965
type: 'layout'
60-
},
61-
schema: [
62-
{
63-
enum: ['always'],
64-
type: 'string'
65-
}
66-
]
66+
}
6767
});

src/rules/requireDescription.js

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,36 @@ export default iterateJsdoc(({
3131
});
3232
}, {
3333
meta: {
34+
schema: [
35+
{
36+
additionalProperties: false,
37+
properties: {
38+
contexts: {
39+
oneOf: [
40+
{
41+
items: {
42+
type: 'string'
43+
},
44+
type: 'array'
45+
},
46+
{
47+
type: 'string'
48+
}
49+
]
50+
},
51+
exemptedBy: {
52+
items: {
53+
type: 'string'
54+
},
55+
type: 'array'
56+
},
57+
noDefaults: {
58+
type: 'boolean'
59+
}
60+
},
61+
type: 'object'
62+
}
63+
],
3464
type: 'suggestion'
3565
},
3666
returns (context) {
@@ -50,35 +80,6 @@ export default iterateJsdoc(({
5080
return noDefaults ?
5181
contexts :
5282
[...new Set([...defaultContexts, ...contexts])];
53-
},
54-
schema: [
55-
{
56-
additionalProperties: false,
57-
properties: {
58-
contexts: {
59-
oneOf: [
60-
{
61-
items: {
62-
type: 'string'
63-
},
64-
type: 'array'
65-
},
66-
{
67-
type: 'string'
68-
}
69-
]
70-
},
71-
exemptedBy: {
72-
items: {
73-
type: 'string'
74-
},
75-
type: 'array'
76-
},
77-
noDefaults: {
78-
type: 'boolean'
79-
}
80-
},
81-
type: 'object'
82-
}
83-
]
83+
}
84+
8485
});

src/rules/requireExample.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ export default iterateJsdoc(({
4242
});
4343
}, {
4444
meta: {
45+
schema: [
46+
{
47+
additionalProperties: false,
48+
properties: {
49+
exemptedBy: {
50+
items: {
51+
type: 'string'
52+
},
53+
type: 'array'
54+
}
55+
},
56+
type: 'object'
57+
}
58+
],
4559
type: 'suggestion'
46-
},
47-
schema: [
48-
{
49-
additionalProperties: false,
50-
properties: {
51-
exemptedBy: {
52-
items: {
53-
type: 'string'
54-
},
55-
type: 'array'
56-
}
57-
},
58-
type: 'object'
59-
}
60-
]
60+
}
6161
});

src/rules/requireHyphenBeforeParamDescription.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ export default iterateJsdoc(({
5656
}, {
5757
meta: {
5858
fixable: 'code',
59+
schema: [
60+
{
61+
enum: ['always', 'never'],
62+
type: 'string'
63+
}
64+
],
5965
type: 'layout'
60-
},
61-
schema: [
62-
{
63-
enum: ['always'],
64-
type: 'string'
65-
}
66-
]
66+
}
6767
});

src/rules/requireParam.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ export default iterateJsdoc(({
3030
});
3131
}, {
3232
meta: {
33+
schema: [
34+
{
35+
additionalProperties: false,
36+
properties: {
37+
exemptedBy: {
38+
items: {
39+
type: 'string'
40+
},
41+
type: 'array'
42+
}
43+
},
44+
type: 'object'
45+
}
46+
],
3347
type: 'suggestion'
34-
},
35-
schema: [
36-
{
37-
additionalProperties: false,
38-
properties: {
39-
exemptedBy: {
40-
items: {
41-
type: 'string'
42-
},
43-
type: 'array'
44-
}
45-
},
46-
type: 'object'
47-
}
48-
]
48+
}
4949
});

src/rules/requireReturns.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,24 @@ export default iterateJsdoc(({
7171
}
7272
}, {
7373
meta: {
74-
type: 'suggestion'
75-
},
76-
schema: [
77-
{
78-
additionalProperties: false,
79-
properties: {
80-
exemptedBy: {
81-
items: {
82-
type: 'string'
74+
schema: [
75+
{
76+
additionalProperties: false,
77+
properties: {
78+
exemptedBy: {
79+
items: {
80+
type: 'string'
81+
},
82+
type: 'array'
8383
},
84-
type: 'array'
84+
forceReturnsWithAsync: {
85+
default: false,
86+
type: 'boolean'
87+
}
8588
},
86-
forceReturnsWithAsync: {
87-
default: false,
88-
type: 'boolean'
89-
}
90-
},
91-
type: 'object'
92-
}
93-
]
89+
type: 'object'
90+
}
91+
],
92+
type: 'suggestion'
93+
}
9494
});

0 commit comments

Comments
 (0)