Skip to content

Commit

Permalink
[change] more specific js-doc validity checks and enable require-jsdo…
Browse files Browse the repository at this point in the history
…c for class and methods also.
  • Loading branch information
Simon Mollweide committed Jun 29, 2016
1 parent 8ea2aa3 commit d878c21
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
21 changes: 20 additions & 1 deletion rules/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,26 @@ module.exports = {

// ensure JSDoc comments are valid
// http://eslint.org/docs/rules/valid-jsdoc
'valid-jsdoc': 2,
'valid-jsdoc': ['error', {
prefer: {
arg: 'param',
argument: 'param',
params: 'param',
class: 'constructor',
return: 'returns',
virtual: 'abstract'
},
preferType: {
Boolean: 'boolean',
Number: 'number',
object: 'Object',
String: 'string',
array: 'Array',
xml: 'XML'
},
requireReturnDescription: true,
requireParamDescription: true
}],

// ensure that the results of typeof are compared against a valid string
'valid-typeof': 2
Expand Down
8 changes: 7 additions & 1 deletion rules/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ module.exports = {

// do not require jsdoc
// http://eslint.org/docs/rules/require-jsdoc
'require-jsdoc': 2,
'require-jsdoc': ['error', {
require: {
FunctionDeclaration: true,
MethodDefinition: true,
ClassDeclaration: true
}
}],

// require or disallow use of semicolons instead of ASI
semi: [2, 'always'],
Expand Down

0 comments on commit d878c21

Please sign in to comment.