Skip to content

Commit 756520a

Browse files
ahwayakchihchiawendt
authored andcommitted
fix(check-indentation): update function and variable names
1 parent 41af93c commit 756520a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rules/checkIndentation.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import iterateJsdoc from '../iterateJsdoc';
22

3-
const maskExamples = (str, excludeTags) => {
4-
const regExamples = new RegExp(`([ \\t]+\\*)[ \\t]@(?:${excludeTags.join('|')})(?=[ \\n])([\\w|\\W]*?\\n)(?=[ \\t]*\\*(?:[ \\t]*@|\\/))`, 'g');
3+
const maskExcludedContent = (str, excludeTags) => {
4+
const regContent = new RegExp(`([ \\t]+\\*)[ \\t]@(?:${excludeTags.join('|')})(?=[ \\n])([\\w|\\W]*?\\n)(?=[ \\t]*\\*(?:[ \\t]*@|\\/))`, 'g');
55

6-
return str.replace(regExamples, (match, margin, code) => {
6+
return str.replace(regContent, (match, margin, code) => {
77
return (new Array(code.match(/\n/g).length + 1)).join(margin + '\n');
88
});
99
};
@@ -20,7 +20,7 @@ export default iterateJsdoc(({
2020
} = options;
2121

2222
const reg = new RegExp(/^(?:\/?\**|[ \t]*)\*[ \t]{2}/gm);
23-
const text = excludeTags.length ? maskExamples(sourceCode.getText(jsdocNode), excludeTags) : sourceCode.getText(jsdocNode);
23+
const text = excludeTags.length ? maskExcludedContent(sourceCode.getText(jsdocNode), excludeTags) : sourceCode.getText(jsdocNode);
2424

2525
if (reg.test(text)) {
2626
const lineBreaks = text.slice(0, reg.lastIndex).match(/\n/g) || [];

0 commit comments

Comments
 (0)