Skip to content

Commit

Permalink
fix(check-line-alignment): escape user tag name in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Jan 27, 2021
1 parent 06f4521 commit c0ae4cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rules/checkLineAlignment.js
@@ -1,5 +1,5 @@
import {
set,
set, escapeRegExp,
} from 'lodash';
import iterateJsdoc from '../iterateJsdoc';

Expand Down Expand Up @@ -112,7 +112,7 @@ const createFixer = (comment, expectedPositions, partsMatrix, lineRegExp, tagInd
* @param {Function} report Report function.
*/
const checkAlignedPerTag = (comment, tag, tagIndentation, report) => {
const lineRegExp = new RegExp(`.*@${tag}[\\s].*`, 'gm');
const lineRegExp = new RegExp(`.*@${escapeRegExp(tag)}[\\s].*`, 'gm');
const lines = comment.value.match(lineRegExp);

if (!lines) {
Expand Down

0 comments on commit c0ae4cb

Please sign in to comment.