Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
add eslint-plugin-jsdoc. fix #44
Browse files Browse the repository at this point in the history
  • Loading branch information
andreineculau committed Nov 1, 2019
1 parent e1af02e commit 2ada1a5
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 43 deletions.
1 change: 1 addition & 0 deletions browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
'./configs/firecloud.js',
'./configs/fp.js',
'./configs/import.js',
'./configs/jsdoc.js',
'./configs/lodash.js',
'./configs/no-null.js',
'./configs/proper-arrows.js',
Expand Down
38 changes: 1 addition & 37 deletions configs/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,43 +372,7 @@ module.exports = {
'template-tag-spacing': ['error', 'never'],
'unicode-bom': 'error',
'use-isnan': 'error',
'valid-jsdoc': ['error', {
prefer: {
// no synonyms
arg: 'param',
argument: 'param',
const: 'constant',
defaultvalue: 'default',
desc: 'description',
emits: 'fires',
exception: 'throws',
extends: 'augments',
fileoverview: 'file',
func: 'function',
host: 'external',
method: 'function',
overview: 'file',
return: 'returns',
var: 'member',
virtual: 'abstract',
yield: 'yields'
},
preferType: {
BigInt: 'bigint',
Boolean: 'boolean',
Null: 'null',
Number: 'number',
String: 'string',
Symbol: 'symbol',
Undefined: 'undefined',
Void: 'void',
array: 'Array',
function: 'Function',
object: 'Object'
},
requireParamDescription: false,
requireReturnDescription: false
}],
'valid-jsdoc': 'off',
'valid-typeof': 'error',
'vars-on-top': 'error',
'wrap-iife': ['error', 'inside'],
Expand Down
14 changes: 14 additions & 0 deletions configs/jsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
extends: [
'plugin:jsdoc/recommended'
],

rules: {
'jsdoc/check-syntax': 'error',
'jsdoc/require-description-complete-sentence': 'error',
'jsdoc/require-hyphen-before-param-description': ['error', 'never'],
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns-description': 'off'
}
};
18 changes: 12 additions & 6 deletions configs/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ module.exports = {
project: './tsconfig.json'
},

settings: {
jsdoc: {
mode: 'typescript'
}
},

rules: {
// 'no-var' is broken atm for typescript, but it will be fixed in a the next version
// see https://github.com/eslint/eslint/pull/11443
Expand Down Expand Up @@ -145,12 +151,12 @@ module.exports = {

// -------------------------------------------------------------------------

// jsdoc types are redundant
// NOTE we assume eslint-plugin-jsdoc is still loaded

// eslint-disable-next-line no-sparse-arrays
'valid-jsdoc': _.merge([, {}], _basic.rules['valid-jsdoc'], [, {
requireParamType: false,
requireReturnType: false
}])
'jsdoc/no-types': 'error',
'jsdoc/require-param-description': 'error',
'jsdoc/require-param-type': 'off',
'jsdoc/require-param': 'off',
'jsdoc/require-returns': 'off'
}
};
1 change: 1 addition & 0 deletions node.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
'./configs/firecloud.js',
'./configs/fp.js',
'./configs/import.js',
'./configs/jsdoc.js',
'./configs/lodash.js',
'./configs/no-null.js',
'./configs/proper-arrows.js',
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"eslint-plugin-firecloud": "git://github.com/tobiipro/eslint-plugin-firecloud.git#semver:~0.1.0",
"eslint-plugin-fp": "^2.3.0",
"eslint-plugin-import": "^2.17.1",
"eslint-plugin-jsdoc": "^17.0.0",
"eslint-plugin-lodash": "^5.0.1",
"eslint-plugin-no-null": "^1.0.2"
},
Expand All @@ -42,6 +43,7 @@
"eslint-plugin-firecloud": "git://github.com/tobiipro/eslint-plugin-firecloud.git#semver:~0.1.0",
"eslint-plugin-fp": "^2.3.0",
"eslint-plugin-import": "^2.17.1",
"eslint-plugin-jsdoc": "^17.0.0",
"eslint-plugin-lodash": "^5.0.1",
"eslint-plugin-no-null": "^1.0.2",
"npm-publish-git": "git://github.com/andreineculau/npm-publish-git.git#semver:~0.0.8"
Expand Down

0 comments on commit 2ada1a5

Please sign in to comment.