@es-joy/jsdoccomment
Advanced tools
Comparing version 0.40.1 to 0.41.0
# CHANGES for `@es-joy/jsdoccomment` | ||
## 0.41.0 | ||
- feat: look above surrounding parenthesis tokens for comment blocks, even if on a higher line than the corresponding AST structure | ||
- chore: update comment-parser and devDeps. | ||
## 0.40.1 | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "@es-joy/jsdoccomment", | ||
"version": "0.40.1", | ||
"version": "0.41.0", | ||
"author": "Brett Zamir <brettz9@yahoo.com>", | ||
@@ -34,2 +34,14 @@ "contributors": [], | ||
], | ||
"scripts": { | ||
"tsc": "tsc", | ||
"open": "open ./coverage/lcov-report/index.html", | ||
"prepublishOnly": "pnpm i && npm run build", | ||
"build": "npm run rollup && tsc -p tsconfig-prod.json", | ||
"rollup": "rollup -c", | ||
"eslint": "eslint --ext=js,cjs,md,html .", | ||
"lint": "npm run eslint --", | ||
"mocha": "mocha --require chai/register-expect.js", | ||
"c8": "c8 npm run mocha", | ||
"test": "npm run lint && npm run build && npm run c8" | ||
}, | ||
"repository": { | ||
@@ -47,3 +59,3 @@ "type": "git", | ||
"dependencies": { | ||
"comment-parser": "1.4.0", | ||
"comment-parser": "1.4.1", | ||
"esquery": "^1.5.0", | ||
@@ -53,49 +65,38 @@ "jsdoc-type-pratt-parser": "~4.0.0" | ||
"devDependencies": { | ||
"@babel/core": "^7.22.9", | ||
"@babel/core": "^7.23.3", | ||
"@babel/plugin-syntax-class-properties": "^7.12.13", | ||
"@babel/preset-env": "^7.22.9", | ||
"@babel/preset-env": "^7.23.3", | ||
"@brettz9/eslint-plugin": "^1.0.4", | ||
"@rollup/plugin-babel": "^6.0.3", | ||
"@types/chai": "^4.3.5", | ||
"@types/eslint": "^8.44.1", | ||
"@types/esquery": "^1.5.0", | ||
"@types/estraverse": "^5.1.2", | ||
"@types/estree": "^1.0.1", | ||
"@types/mocha": "^10.0.1", | ||
"@typescript-eslint/types": "^6.2.1", | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@types/chai": "^4.3.10", | ||
"@types/eslint": "^8.44.7", | ||
"@types/esquery": "^1.5.3", | ||
"@types/estraverse": "^5.1.6", | ||
"@types/estree": "^1.0.5", | ||
"@types/mocha": "^10.0.4", | ||
"@typescript-eslint/types": "^6.10.0", | ||
"c8": "^8.0.1", | ||
"chai": "^4.3.7", | ||
"eslint": "^8.46.0", | ||
"eslint-config-ash-nazg": "34.15.0", | ||
"chai": "^4.3.10", | ||
"eslint": "^8.53.0", | ||
"eslint-config-ash-nazg": "35.1.0", | ||
"eslint-config-standard": "^17.1.0", | ||
"eslint-plugin-array-func": "^3.1.8", | ||
"eslint-plugin-compat": "^4.1.4", | ||
"eslint-plugin-array-func": "^4.0.0", | ||
"eslint-plugin-compat": "^4.2.0", | ||
"eslint-plugin-eslint-comments": "^3.2.0", | ||
"eslint-plugin-html": "^7.1.0", | ||
"eslint-plugin-import": "^2.28.0", | ||
"eslint-plugin-jsdoc": "^46.4.5", | ||
"eslint-plugin-import": "^2.29.0", | ||
"eslint-plugin-jsdoc": "^46.8.2", | ||
"eslint-plugin-markdown": "^3.0.1", | ||
"eslint-plugin-n": "^16.0.1", | ||
"eslint-plugin-n": "^16.3.0", | ||
"eslint-plugin-no-unsanitized": "^4.0.2", | ||
"eslint-plugin-no-use-extend-native": "^0.5.0", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"eslint-plugin-sonarjs": "^0.20.0", | ||
"eslint-plugin-unicorn": "^48.0.1", | ||
"eslint-plugin-sonarjs": "^0.23.0", | ||
"eslint-plugin-unicorn": "^49.0.0", | ||
"espree": "^9.6.1", | ||
"estraverse": "^5.3.0", | ||
"mocha": "^10.2.0", | ||
"rollup": "^3.27.2", | ||
"typescript": "^5.1.6" | ||
}, | ||
"scripts": { | ||
"tsc": "tsc", | ||
"open": "open ./coverage/lcov-report/index.html", | ||
"build": "npm run rollup && tsc -p tsconfig-prod.json", | ||
"rollup": "rollup -c", | ||
"eslint": "eslint --ext=js,cjs,md,html .", | ||
"lint": "npm run eslint --", | ||
"mocha": "mocha --require chai/register-expect.js", | ||
"c8": "c8 npm run mocha", | ||
"test": "npm run lint && npm run build && npm run c8" | ||
"rollup": "^4.3.0", | ||
"typescript": "^5.2.2" | ||
} | ||
} | ||
} |
@@ -271,2 +271,3 @@ import {parse as jsdocTypePrattParse} from 'jsdoc-type-pratt-parser'; | ||
const { | ||
// eslint-disable-next-line no-unused-vars -- Discarding | ||
end: ed, | ||
@@ -273,0 +274,0 @@ delimiter: de, |
@@ -289,2 +289,3 @@ /* eslint-disable jsdoc/imports-as-dependencies -- https://github.com/gajus/eslint-plugin-jsdoc/issues/1114 */ | ||
let tokenBefore = null; | ||
let parenthesisToken = null; | ||
@@ -304,2 +305,3 @@ while (currentNode) { | ||
) { | ||
parenthesisToken = tokenBefore; | ||
[tokenBefore] = sourceCode.getTokensBefore(currentNode, { | ||
@@ -328,4 +330,10 @@ count: 2, | ||
(/^\*\s/u).test(tokenBefore.value) && | ||
currentNode.loc.start.line - tokenBefore.loc.end.line >= minLines && | ||
currentNode.loc.start.line - tokenBefore.loc.end.line <= maxLines | ||
currentNode.loc.start.line - ( | ||
/** @type {import('eslint').AST.Token} */ | ||
(parenthesisToken ?? tokenBefore) | ||
).loc.end.line >= minLines && | ||
currentNode.loc.start.line - ( | ||
/** @type {import('eslint').AST.Token} */ | ||
(parenthesisToken ?? tokenBefore) | ||
).loc.end.line <= maxLines | ||
) { | ||
@@ -332,0 +340,0 @@ return tokenBefore; |
@@ -42,7 +42,5 @@ /** | ||
// eslint-disable-next-line prefer-regex-literals -- Need 'd' (indices) flag | ||
const prefixedTextPattern = new RegExp(/(?:\[(?<text>[^\]]+)\])\{@(?<tag>[^}\s]+)\s?(?<namepathOrURL>[^}\s|]*)\}/gu, 'gud'); | ||
// The pattern used to match for text after tag uses a negative lookbehind | ||
// on the ']' char to avoid matching the prefixed case too. | ||
// eslint-disable-next-line prefer-regex-literals -- Need 'd' (indices) flag | ||
const suffixedAfterPattern = new RegExp(/(?<!\])\{@(?<tag>[^}\s]+)\s?(?<namepathOrURL>[^}\s|]*)\s*(?<separator>[\s|])?\s*(?<text>[^}]*)\}/gu, 'gud'); | ||
@@ -49,0 +47,0 @@ |
@@ -14,4 +14,3 @@ { | ||
"target": "es6", | ||
"outDir": "dist", | ||
"allowSyntheticDefaultImports": true | ||
"outDir": "dist" | ||
}, | ||
@@ -18,0 +17,0 @@ "include": ["src/**/*.js"], |
@@ -13,4 +13,3 @@ { | ||
"target": "es6", | ||
"outDir": "dist", | ||
"allowSyntheticDefaultImports": true | ||
"outDir": "dist" | ||
}, | ||
@@ -17,0 +16,0 @@ "include": ["src/**/*.js", "test/**/*.js", "typings/espree.d.ts"], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
113298
2659
10
+ Addedcomment-parser@1.4.1(transitive)
- Removedcomment-parser@1.4.0(transitive)
Updatedcomment-parser@1.4.1