Skip to content

Commit 982debb

Browse files
brettz9l1bbcsg
authored andcommitted
chore: update devDeps and apply comma-dangle linting rule
1 parent 23846fc commit 982debb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2813
-2803
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121
"@babel/plugin-transform-flow-strip-types": "^7.4.4",
2222
"@babel/preset-env": "^7.5.5",
2323
"@babel/register": "^7.5.5",
24-
"@typescript-eslint/parser": "^1.12.0",
24+
"@typescript-eslint/parser": "^1.13.0",
2525
"babel-eslint": "^10.0.2",
2626
"babel-plugin-add-module-exports": "^1.0.2",
27-
"babel-plugin-istanbul": "^5.1.4",
27+
"babel-plugin-istanbul": "^5.2.0",
2828
"chai": "^4.2.0",
29-
"eslint": "^6.0.1",
30-
"eslint-config-canonical": "^17.1.4",
29+
"eslint": "^6.1.0",
30+
"eslint-config-canonical": "^17.3.3",
3131
"gitdown": "^3.1.1",
3232
"glob": "^7.1.4",
33-
"husky": "^3.0.1",
33+
"husky": "^3.0.2",
3434
"mocha": "^6.2.0",
3535
"nyc": "^14.1.1",
36-
"semantic-release": "^15.13.18",
36+
"semantic-release": "^15.13.19",
3737
"typescript": "^3.5.3"
3838
},
3939
"engines": {

src/bin/generateReadme.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const getAssertions = () => {
6060

6161
return {
6262
invalid: _.map(codes.invalid, formatCodeSnippet),
63-
valid: _.map(codes.valid, formatCodeSnippet)
63+
valid: _.map(codes.valid, formatCodeSnippet),
6464
};
6565
});
6666

@@ -81,8 +81,8 @@ const generateReadme = async () => {
8181
gitdown.setConfig({
8282
gitinfo: {
8383
defaultBranchName: getSomeBranch() || 'master',
84-
gitPath: path.join(__dirname, '../../.git')
85-
}
84+
gitPath: path.join(__dirname, '../../.git'),
85+
},
8686
});
8787
let documentBody = await gitdown.get();
8888

src/exportParser.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const debug = debugModule('requireExportJsdoc');
44

55
const createNode = function () {
66
return {
7-
props: {}
7+
props: {},
88
};
99
};
1010

@@ -392,7 +392,7 @@ const parse = function (ast, node, opt) {
392392
ancestorsOnly: false,
393393
esm: true,
394394
initModuleExports: true,
395-
initWindow: true
395+
initWindow: true,
396396
};
397397

398398
const globalVars = createNode();
@@ -414,7 +414,7 @@ const parse = function (ast, node, opt) {
414414
}
415415

416416
return {
417-
globalVars
417+
globalVars,
418418
};
419419
};
420420

@@ -424,5 +424,5 @@ const isExported = function (node, parseResult, opt) {
424424

425425
export default {
426426
isExported,
427-
parse
427+
parse,
428428
};

src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ export default {
5656
'jsdoc/require-returns-check': 'warn',
5757
'jsdoc/require-returns-description': 'warn',
5858
'jsdoc/require-returns-type': 'warn',
59-
'jsdoc/valid-types': 'warn'
60-
}
61-
}
59+
'jsdoc/valid-types': 'warn',
60+
},
61+
},
6262
},
6363
rules: {
6464
'check-alignment': checkAlignment,
@@ -86,6 +86,6 @@ export default {
8686
'require-returns-check': requireReturnsCheck,
8787
'require-returns-description': requireReturnsDescription,
8888
'require-returns-type': requireReturnsType,
89-
'valid-types': validTypes
90-
}
89+
'valid-types': validTypes,
90+
},
9191
};

src/iterateJsdoc.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ const parseComment = (commentNode, indent, trim = true) => {
5555
if (result) {
5656
return {
5757
data: {
58-
description: result[1] === undefined ? '' : result[1]
58+
description: result[1] === undefined ? '' : result[1],
5959
},
60-
source: result[0]
60+
source: result[0],
6161
};
6262
}
6363

6464
// Always has at least whitespace due to `indent` we've added
6565
/* istanbul ignore next */
6666
return null;
67-
}
67+
},
6868
],
69-
trim
69+
trim,
7070
})[0] || {};
7171
};
7272

@@ -80,7 +80,7 @@ const getUtils = (
8080
implementsReplacesDocs,
8181
augmentsExtendsReplacesDocs,
8282
maxLines,
83-
minLines
83+
minLines,
8484
},
8585
report,
8686
context
@@ -142,7 +142,7 @@ const getUtils = (
142142
if (skipReportingBlockedTag) {
143143
return {
144144
blocked: true,
145-
tagName
145+
tagName,
146146
};
147147
}
148148
const message = isObject && ret.message || defaultMessage;
@@ -265,7 +265,7 @@ const getUtils = (
265265
const classNode = utils.getClassNode();
266266
const classJsdocNode = getJSDocComment(sourceCode, classNode, {
267267
maxLines,
268-
minLines
268+
minLines,
269269
});
270270

271271
if (classJsdocNode) {
@@ -286,15 +286,15 @@ const getUtils = (
286286
utils.forEachPreferredTag = (tagName, arrayHandler, skipReportingBlockedTag = false) => {
287287
const targetTagName = utils.getPreferredTagName({
288288
skipReportingBlockedTag,
289-
tagName
289+
tagName,
290290
});
291291
if (!targetTagName ||
292292
skipReportingBlockedTag && targetTagName && typeof targetTagName === 'object'
293293
) {
294294
return;
295295
}
296296
const matchingJsdocTags = _.filter(jsdoc.tags || [], {
297-
tag: targetTagName
297+
tag: targetTagName,
298298
});
299299

300300
matchingJsdocTags.forEach((matchingJsdocTag) => {
@@ -307,10 +307,10 @@ const getUtils = (
307307
loc: {
308308
start: {
309309
column: 1,
310-
line: 1
311-
}
310+
line: 1,
311+
},
312312
},
313-
message
313+
message,
314314
});
315315
};
316316

@@ -354,7 +354,7 @@ const makeReport = (context, commentNode) => {
354354

355355
loc = {
356356
end: {line: lineNumber},
357-
start: {line: lineNumber}
357+
start: {line: lineNumber},
358358
};
359359
if (jsdocLoc.column) {
360360
const colNumber = commentNode.loc.start.column + jsdocLoc.column;
@@ -369,7 +369,7 @@ const makeReport = (context, commentNode) => {
369369
fix,
370370
loc,
371371
message,
372-
node: commentNode
372+
node: commentNode,
373373
});
374374
};
375375

@@ -429,19 +429,19 @@ const iterateAllJsdocs = (iterator, ruleConfig) => {
429429
report,
430430
settings,
431431
sourceCode,
432-
utils: getUtils(null, jsdoc, jsdocNode, settings, report, context)
432+
utils: getUtils(null, jsdoc, jsdocNode, settings, report, context),
433433
});
434434
});
435-
}
435+
},
436436
};
437437
},
438-
meta: ruleConfig.meta
438+
meta: ruleConfig.meta,
439439
};
440440
};
441441

442442
export {
443443
getSettings,
444-
parseComment
444+
parseComment,
445445
};
446446

447447
/**
@@ -464,7 +464,7 @@ export default function iterateJsdoc (iterator, ruleConfig) {
464464
if (ruleConfig.iterateAllJsdocs) {
465465
return iterateAllJsdocs(iterator, {
466466
meta: ruleConfig.meta,
467-
noTrim: ruleConfig.noTrim
467+
noTrim: ruleConfig.noTrim,
468468
});
469469
}
470470

@@ -521,7 +521,7 @@ export default function iterateJsdoc (iterator, ruleConfig) {
521521
report,
522522
settings,
523523
sourceCode,
524-
utils
524+
utils,
525525
});
526526
};
527527

@@ -534,9 +534,9 @@ export default function iterateJsdoc (iterator, ruleConfig) {
534534
return {
535535
ArrowFunctionExpression: checkJsdoc,
536536
FunctionDeclaration: checkJsdoc,
537-
FunctionExpression: checkJsdoc
537+
FunctionExpression: checkJsdoc,
538538
};
539539
},
540-
meta: ruleConfig.meta
540+
meta: ruleConfig.meta,
541541
};
542542
}

src/jsdocUtils.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const getJsdocParameterNamesDeep = (jsdoc : Object, targetTagName : string) : Ar
4040
let jsdocParameterNames;
4141

4242
jsdocParameterNames = _.filter(jsdoc.tags, {
43-
tag: targetTagName
43+
tag: targetTagName,
4444
});
4545

4646
jsdocParameterNames = _.map(jsdocParameterNames, 'name');
@@ -144,7 +144,7 @@ const namepathDefiningTags = [
144144
'interface',
145145
'member', 'var',
146146
'mixin',
147-
'namespace'
147+
'namespace',
148148
];
149149

150150
const namepathPointingTags = [
@@ -163,7 +163,7 @@ const namepathPointingTags = [
163163
// MAY BE USEFUL WITHOUT NAMEPATH
164164
'emits',
165165
'fires',
166-
'listens'
166+
'listens',
167167
];
168168

169169
const isNamepathDefiningTag = (tagName) => {
@@ -219,11 +219,11 @@ let tagsWithTypes = [
219219
'throws',
220220
'type',
221221
'typedef',
222-
'yields'
222+
'yields',
223223
];
224224

225225
const closureTagsWithTypes = [
226-
'package', 'private', 'protected', 'public', 'static'
226+
'package', 'private', 'protected', 'public', 'static',
227227
];
228228

229229
const tagsWithTypesAliases = [
@@ -235,7 +235,7 @@ const tagsWithTypesAliases = [
235235
'prop',
236236
'return',
237237
'exception',
238-
'yield'
238+
'yield',
239239
];
240240

241241
tagsWithTypes = tagsWithTypes.concat(tagsWithTypesAliases, closureTagsWithTypes);
@@ -366,8 +366,8 @@ const enforcedContexts = (context, defaultContexts) => {
366366
contexts = defaultContexts === true ? [
367367
'ArrowFunctionExpression',
368368
'FunctionDeclaration',
369-
'FunctionExpression'
370-
] : defaultContexts
369+
'FunctionExpression',
370+
] : defaultContexts,
371371
} = context.options[0] || {};
372372

373373
return contexts;
@@ -393,7 +393,7 @@ const tagsWithNamesAndDescriptions = [
393393
'param', 'arg', 'argument', 'property', 'prop',
394394

395395
// These two are parsed by our custom parser as though having a `name`
396-
'returns', 'return'
396+
'returns', 'return',
397397
];
398398

399399
const getTagsByType = (tags, tagPreference) => {
@@ -411,7 +411,7 @@ const getTagsByType = (tags, tagPreference) => {
411411

412412
return {
413413
tagsWithNames,
414-
tagsWithoutNames
414+
tagsWithoutNames,
415415
};
416416
};
417417

@@ -457,5 +457,5 @@ export default {
457457
isTagWithMandatoryNamepathOrType,
458458
isTagWithType,
459459
isValidTag,
460-
parseClosureTemplateTag
460+
parseClosureTemplateTag,
461461
};

src/rules/checkAlignment.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default iterateJsdoc(({
55
sourceCode,
66
jsdocNode,
77
report,
8-
indent
8+
indent,
99
}) => {
1010
// `indent` is whitespace from line 1 (`/**`), so slice and account for "/".
1111
const indentLevel = indent.length + 1;
@@ -34,7 +34,7 @@ export default iterateJsdoc(({
3434
sourceLines.some((line, lineNum) => {
3535
if (line.length !== indentLevel) {
3636
report('Expected JSDoc block to be aligned.', fix, {
37-
line: lineNum + 1
37+
line: lineNum + 1,
3838
});
3939

4040
return true;
@@ -46,6 +46,6 @@ export default iterateJsdoc(({
4646
iterateAllJsdocs: true,
4747
meta: {
4848
fixable: 'code',
49-
type: 'layout'
50-
}
49+
type: 'layout',
50+
},
5151
});

0 commit comments

Comments
 (0)