Skip to content

Commit a876af8

Browse files
committed
fix: apply style fixes
1 parent 9f29610 commit a876af8

File tree

9 files changed

+24
-15
lines changed

9 files changed

+24
-15
lines changed

.eslintrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"import/extensions": 0,
2929
"prefer-named-capture-group": 0,
3030
"unicorn/no-array-reduce": 0,
31+
"unicorn/no-unsafe-regex": 0,
32+
"unicorn/prefer-array-some": 0,
3133
"unicorn/prevent-abbreviations": 0
3234
}
3335
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"chai": "^4.3.4",
3333
"cross-env": "^7.0.3",
3434
"eslint": "^8.1.0",
35-
"eslint-config-canonical": "^32.10.0",
35+
"eslint-config-canonical": "^32.12.1",
3636
"gitdown": "^3.1.4",
3737
"glob": "^7.2.0",
3838
"husky": "^7.0.4",

src/exportParser.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,9 @@ const isUncommentedExport = function (node, sourceCode, opt, settings) {
553553
return true;
554554
}
555555

556-
/** Some typescript types are not in variable map, but inherit exported (interface property and method)*/
556+
/**
557+
* Some typescript types are not in variable map, but inherit exported (interface property and method)
558+
*/
557559
if (
558560
isExportByAncestor(node) &&
559561
!findJSDocComment(node, sourceCode, settings)

src/iterateJsdoc.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
/* eslint-disable jsdoc/valid-types */
2+
13
import {
2-
getReducedASTNode, getJSDocComment, commentHandler, parseComment,
4+
getReducedASTNode,
5+
getJSDocComment,
6+
commentHandler,
7+
parseComment,
38
} from '@es-joy/jsdoccomment';
49
import {
510
stringify as commentStringify,

src/jsdocUtils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable jsdoc/no-undefined-types */
2+
13
import _ from 'lodash';
24
import WarnSettings from './WarnSettings';
35
import getDefaultTagStructureForMode from './getDefaultTagStructureForMode';
@@ -1095,7 +1097,9 @@ const hasThrowValue = (node, innerFunction) => {
10951097
}
10961098
};
10971099
1098-
/** @param {string} tag */
1100+
/**
1101+
* @param {string} tag
1102+
*/
10991103
/*
11001104
const isInlineTag = (tag) => {
11011105
return /^(@link|@linkcode|@linkplain|@tutorial) /u.test(tag);

src/rules/checkExamples.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export default iterateJsdoc(({
249249
/**
250250
*
251251
* @param {string} filename
252-
* @param {string} [ext="md/*.js"] Since `eslint-plugin-markdown` v2, and
252+
* @param {string} [ext] Since `eslint-plugin-markdown` v2, and
253253
* ESLint 7, this is the default which other JS-fenced rules will used.
254254
* Formerly "md" was the default.
255255
* @returns {{defaultFileName: string, fileName: string}}

src/rules/checkIndentation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ const maskExcludedContent = (str, excludeTags) => {
44
const regContent = new RegExp(`([ \\t]+\\*)[ \\t]@(?:${excludeTags.join('|')})(?=[ \\n])([\\w|\\W]*?\\n)(?=[ \\t]*\\*(?:[ \\t]*@|\\/))`, 'gu');
55

66
return str.replace(regContent, (_match, margin, code) => {
7-
return new Array(code.match(/\n/gu).length + 1).join(margin + '\n');
7+
return Array.from({length: code.match(/\n/gu).length + 1}).join(margin + '\n');
88
});
99
};
1010

1111
const maskCodeBlocks = (str) => {
1212
const regContent = /([ \t]+\*)[ \t]```[^\n]*?([\w|\W]*?\n)(?=[ \t]*\*(?:[ \t]*(?:```|@\w+\s)|\/))/gu;
1313

1414
return str.replace(regContent, (_match, margin, code) => {
15-
return new Array(code.match(/\n/gu).length + 1).join(margin + '\n');
15+
return Array.from({length: code.match(/\n/gu).length + 1}).join(margin + '\n');
1616
});
1717
};
1818

src/rules/requireThrows.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ import iterateJsdoc from '../iterateJsdoc';
44
* We can skip checking for a throws value, in case the documentation is inherited
55
* or the method is either a constructor or an abstract method.
66
*
7-
* @param {*} utils
8-
* a reference to the utils which are used to probe if a tag is present or not.
9-
* @returns {boolean}
10-
* true in case deep checking can be skipped; otherwise false.
7+
* @param {*} utils a reference to the utils which are used to probe if a tag is present or not.
8+
* @returns {boolean} true in case deep checking can be skipped; otherwise false.
119
*/
1210
const canSkip = (utils) => {
1311
return utils.hasATag([

src/rules/requireYields.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import iterateJsdoc from '../iterateJsdoc';
66
*
77
* In either of these cases the yield value is optional or not defined.
88
*
9-
* @param {*} utils
10-
* a reference to the utils which are used to probe if a tag is present or not.
11-
* @returns {boolean}
12-
* true in case deep checking can be skipped; otherwise false.
9+
* @param {*} utils a reference to the utils which are used to probe if a tag is present or not.
10+
* @returns {boolean} true in case deep checking can be skipped; otherwise false.
1311
*/
1412
const canSkip = (utils) => {
1513
return utils.hasATag([

0 commit comments

Comments
 (0)