eslint-plugin-isaacscript
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -213,4 +213,11 @@ "use strict"; | ||
const singleLineLength = leftWhitespaceLength + "/** ".length + text.length + " */".length; | ||
// JSDoc comments that specify parameter documentation should never be moved to a single line | ||
const hasJSDocTag = text.startsWith("@"); | ||
return singleLineLength <= maxLength && !hasJSDocTag; | ||
if (hasJSDocTag) { | ||
const tagHasSomethingAfterIt = text.includes(" "); | ||
if (tagHasSomethingAfterIt) { | ||
return false; | ||
} | ||
} | ||
return singleLineLength <= maxLength; | ||
} | ||
@@ -217,0 +224,0 @@ function getFormattedJSDocCommentSingleLine(text, leftWhitespace) { |
@@ -144,23 +144,27 @@ "use strict"; | ||
const firstCommentStartLine = comment.loc.start.line; | ||
// Look for one or more "connecting" comments on the next subsequent lines | ||
for (let j = i + 1; j < comments.length; j++) { | ||
const nextComment = comments[j]; | ||
if (nextComment === undefined) { | ||
break; | ||
// Ignore "block" comments | ||
const hasAllHyphens = /^\s*-+\s*$/.test(text); | ||
if (!hasAllHyphens) { | ||
// Look for one or more "connecting" comments on the next subsequent lines | ||
for (let j = i + 1; j < comments.length; j++) { | ||
const nextComment = comments[j]; | ||
if (nextComment === undefined) { | ||
break; | ||
} | ||
// Break if we are on a non-contiguous line | ||
const nextCommentStartLine = nextComment.loc.start.line; | ||
const lineDelta = j - commentIndex; | ||
if (nextCommentStartLine !== firstCommentStartLine + lineDelta) { | ||
break; | ||
} | ||
// Break if the next line starts with a bullet point | ||
if ((0, comments_1.startsWithBulletPoint)(nextComment.value)) { | ||
break; | ||
} | ||
commentBlock.mergedText += " "; | ||
commentBlock.mergedText += nextComment.value.trim(); | ||
commentBlock.originalComments.push(nextComment); | ||
// Since we merged this comment, we can skip over examining it in the parent for loop | ||
i += 1; | ||
} | ||
// Break if we are on a non-contiguous line | ||
const nextCommentStartLine = nextComment.loc.start.line; | ||
const lineDelta = j - commentIndex; | ||
if (nextCommentStartLine !== firstCommentStartLine + lineDelta) { | ||
break; | ||
} | ||
// Break if the next line starts with a bullet point | ||
if ((0, comments_1.startsWithBulletPoint)(nextComment.value)) { | ||
break; | ||
} | ||
commentBlock.mergedText += " "; | ||
commentBlock.mergedText += nextComment.value.trim(); | ||
commentBlock.originalComments.push(nextComment); | ||
// Since we merged this comment, we can skip over examining it in the parent for loop | ||
i += 1; | ||
} | ||
@@ -167,0 +171,0 @@ commentBlocks.push(commentBlock); |
{ | ||
"name": "eslint-plugin-isaacscript", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/Zamiell/eslint-plugin-isaacscript", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82496
1082