Skip to content

Commit

Permalink
fix: make options schemas effective
Browse files Browse the repository at this point in the history
  • Loading branch information
golopot committed Jun 21, 2019
1 parent da25e1b commit 5008fcf
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 93 deletions.
14 changes: 7 additions & 7 deletions src/rules/newlineAfterDescription.js
Expand Up @@ -56,12 +56,12 @@ export default iterateJsdoc(({
}, {
meta: {
fixable: 'whitespace',
schema: [
{
enum: ['always', 'never'],
type: 'string'
}
],
type: 'layout'
},
schema: [
{
enum: ['always'],
type: 'string'
}
]
}
});
63 changes: 32 additions & 31 deletions src/rules/requireDescription.js
Expand Up @@ -31,6 +31,36 @@ export default iterateJsdoc(({
});
}, {
meta: {
schema: [
{
additionalProperties: false,
properties: {
contexts: {
oneOf: [
{
items: {
type: 'string'
},
type: 'array'
},
{
type: 'string'
}
]
},
exemptedBy: {
items: {
type: 'string'
},
type: 'array'
},
noDefaults: {
type: 'boolean'
}
},
type: 'object'
}
],
type: 'suggestion'
},
returns (context) {
Expand All @@ -50,35 +80,6 @@ export default iterateJsdoc(({
return noDefaults ?
contexts :
[...new Set([...defaultContexts, ...contexts])];
},
schema: [
{
additionalProperties: false,
properties: {
contexts: {
oneOf: [
{
items: {
type: 'string'
},
type: 'array'
},
{
type: 'string'
}
]
},
exemptedBy: {
items: {
type: 'string'
},
type: 'array'
},
noDefaults: {
type: 'boolean'
}
},
type: 'object'
}
]
}

});
30 changes: 15 additions & 15 deletions src/rules/requireExample.js
Expand Up @@ -42,20 +42,20 @@ export default iterateJsdoc(({
});
}, {
meta: {
schema: [
{
additionalProperties: false,
properties: {
exemptedBy: {
items: {
type: 'string'
},
type: 'array'
}
},
type: 'object'
}
],
type: 'suggestion'
},
schema: [
{
additionalProperties: false,
properties: {
exemptedBy: {
items: {
type: 'string'
},
type: 'array'
}
},
type: 'object'
}
]
}
});
14 changes: 7 additions & 7 deletions src/rules/requireHyphenBeforeParamDescription.js
Expand Up @@ -56,12 +56,12 @@ export default iterateJsdoc(({
}, {
meta: {
fixable: 'code',
schema: [
{
enum: ['always', 'never'],
type: 'string'
}
],
type: 'layout'
},
schema: [
{
enum: ['always'],
type: 'string'
}
]
}
});
30 changes: 15 additions & 15 deletions src/rules/requireParam.js
Expand Up @@ -30,20 +30,20 @@ export default iterateJsdoc(({
});
}, {
meta: {
schema: [
{
additionalProperties: false,
properties: {
exemptedBy: {
items: {
type: 'string'
},
type: 'array'
}
},
type: 'object'
}
],
type: 'suggestion'
},
schema: [
{
additionalProperties: false,
properties: {
exemptedBy: {
items: {
type: 'string'
},
type: 'array'
}
},
type: 'object'
}
]
}
});
36 changes: 18 additions & 18 deletions src/rules/requireReturns.js
Expand Up @@ -71,24 +71,24 @@ export default iterateJsdoc(({
}
}, {
meta: {
type: 'suggestion'
},
schema: [
{
additionalProperties: false,
properties: {
exemptedBy: {
items: {
type: 'string'
schema: [
{
additionalProperties: false,
properties: {
exemptedBy: {
items: {
type: 'string'
},
type: 'array'
},
type: 'array'
forceReturnsWithAsync: {
default: false,
type: 'boolean'
}
},
forceReturnsWithAsync: {
default: false,
type: 'boolean'
}
},
type: 'object'
}
]
type: 'object'
}
],
type: 'suggestion'
}
});

0 comments on commit 5008fcf

Please sign in to comment.