Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require-description-complete-sentence crashes if line contains mismatched parentheses #62

Closed
cscott opened this issue Feb 27, 2018 · 0 comments

Comments

@cscott
Copy link
Contributor

cscott commented Feb 27, 2018

Invalid regular expression: /underlying objects) and "stack" (a stack trace, if any)$/: Unmatched ')'
SyntaxError: Invalid regular expression: /underlying objects) and "stack" (a stack trace, if any)$/: Unmatched ')'
    at new RegExp (native)
    at Object.fix (/home/cananian/Projects/Wikimedia/Parsoid/node_modules/eslint-plugin-jsdoc/dist/rules/requireDescriptionCompleteSentence.js:78:29)

The culprit is this code:

      if (!/[.:?!]$/.test(paragraph)) {
        var line = _lodash2.default.last(paragraph.split('\n'));

        text = text.replace(new RegExp(line + '$', 'm'), line + '.');
      }
cscott added a commit to cscott/eslint-plugin-jsdoc that referenced this issue Feb 27, 2018
cscott added a commit to cscott/eslint-plugin-jsdoc that referenced this issue Feb 27, 2018
cscott added a commit to cscott/eslint-plugin-jsdoc that referenced this issue Feb 27, 2018
wmfgerrit pushed a commit to wikimedia/mediawiki-services-parsoid that referenced this issue Feb 27, 2018
The summary is the first sentence of the method/class description.  In
some cases we're missing a period so our "summary" runs on and on.

Many of these were fixed up automatically by the
`jsdoc/require-description-complete-sentence` eslint rule, but
it has a few bugs yet (especially
gajus/eslint-plugin-jsdoc#62 ) so we
can't yet turn it on by default.

Change-Id: I5163ed2c52b21090ce018573bb3ff06d50620d73
@gajus gajus closed this as completed in #64 Mar 9, 2018
cscott added a commit to cscott/wikimedia-langconv that referenced this issue Sep 6, 2018
The summary is the first sentence of the method/class description.  In
some cases we're missing a period so our "summary" runs on and on.

Many of these were fixed up automatically by the
`jsdoc/require-description-complete-sentence` eslint rule, but
it has a few bugs yet (especially
gajus/eslint-plugin-jsdoc#62 ) so we
can't yet turn it on by default.

Change-Id: I5163ed2c52b21090ce018573bb3ff06d50620d73
cscott added a commit to cscott/mediawiki-extensions-Cite that referenced this issue Jan 11, 2024
The summary is the first sentence of the method/class description.  In
some cases we're missing a period so our "summary" runs on and on.

Many of these were fixed up automatically by the
`jsdoc/require-description-complete-sentence` eslint rule, but
it has a few bugs yet (especially
gajus/eslint-plugin-jsdoc#62 ) so we
can't yet turn it on by default.

Change-Id: I5163ed2c52b21090ce018573bb3ff06d50620d73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant