Skip to content

Commit

Permalink
fix: resolve bug in fixer due to \r being captured into wrong group
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed Jul 24, 2023
1 parent a37ebe2 commit 0a92907
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var findJSDoc = require( '@stdlib/_tools/eslint/utils/find-jsdoc' );

// VARIABLES //

var RE_MULTIPLE_BLANK_LINES = /(\s*\*\s*\r?\n\s*\*\s*)(\r?\n\s*(?:\*|$))+/g;
var RE_MULTIPLE_BLANK_LINES = /(\s*\*[ \t]*\r?\n\s*\*[ \t]*)(\r?\n\s*(?:\*|$))+/g;
var rule;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,55 @@ test = {
};
invalid.push( test );

test = {
'code': [
'/**',
'* Evaluates a rational function, i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\).',
'*',
'* ## Notes',
'*',
'* - Coefficients should be sorted in ascending degree.',
'* - The implementation uses [Horner\'s rule][horners-method] for efficient computation.',
'*',
'* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method',
'*',
'*',
'* @private',
'* @param {number} x - value at which to evaluate the rational function',
'* @returns {number} evaluated rational function',
'*/',
'function evalrational( x ) {',
' return x;',
'}'
].join( '\r\n' ),
'errors': [
{
'message': 'JSDoc comments should not have multiple subsequent blank lines',
'type': null
}
],
'output': [
'/**',
'* Evaluates a rational function, i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\).',
'*',
'* ## Notes',
'*',
'* - Coefficients should be sorted in ascending degree.',
'* - The implementation uses [Horner\'s rule][horners-method] for efficient computation.',
'*',
'* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method',
'*',
'* @private',
'* @param {number} x - value at which to evaluate the rational function',
'* @returns {number} evaluated rational function',
'*/',
'function evalrational( x ) {',
' return x;',
'}'
].join( '\r\n' )
};
invalid.push( test );


// EXPORTS //

Expand Down

0 comments on commit 0a92907

Please sign in to comment.