@cjser/es-joy__jsdoccomment 0.96.0-cjser.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +883 -0
- package/LICENSE-MIT.txt +20 -0
- package/README.md +250 -0
- package/dist/index.d.ts +421 -0
- package/dist-cjser/index.cjs +1224 -0
- package/package.json +144 -0
- package/src/commentHandler.js +48 -0
- package/src/commentParserToESTree.js +525 -0
- package/src/estreeToString.js +234 -0
- package/src/index.js +59 -0
- package/src/inlineTagEscapes.js +73 -0
- package/src/jsdoccomment.js +705 -0
- package/src/parseComment.js +190 -0
- package/src/parseInlineTags.js +114 -0
- package/src/toCamelCase.js +13 -0
package/package.json
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cjser/es-joy__jsdoccomment",
|
|
3
|
+
"version": "0.96.0-cjser.2",
|
|
4
|
+
"author": "Brett Zamir <brettz9@yahoo.com>",
|
|
5
|
+
"contributors": [],
|
|
6
|
+
"description": "Maintained replacement for ESLint's deprecated SourceCode#getJSDocComment along with other jsdoc utilities",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"ast",
|
|
10
|
+
"comment",
|
|
11
|
+
"estree",
|
|
12
|
+
"jsdoc",
|
|
13
|
+
"parser",
|
|
14
|
+
"eslint",
|
|
15
|
+
"sourcecode"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"require": "./dist-cjser/index.cjs",
|
|
23
|
+
"default": "./src/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"browserslist": [
|
|
27
|
+
"defaults, not op_mini all"
|
|
28
|
+
],
|
|
29
|
+
"typedocOptions": {
|
|
30
|
+
"dmtLinksService": {
|
|
31
|
+
"GitHub": "https://github.com/es-joy/jsdoccomment",
|
|
32
|
+
"NPM": "https://www.npmjs.com/package/@es-joy/jsdoccomment"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://code.moenext.com/3rdeye/cjser.git"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/es-joy/jsdoccomment/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/es-joy/jsdoccomment",
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": "^22.22.2 || >=24.15.0"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@types/estree": "^1.0.9",
|
|
48
|
+
"@typescript-eslint/types": "^8.67.0",
|
|
49
|
+
"comment-parser": "1.4.8",
|
|
50
|
+
"esquery": "^1.7.0",
|
|
51
|
+
"@cjser/jsdoc-type-pratt-parser": "9.2.1-cjser.2"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
55
|
+
"@brettz9/node-static": "^0.1.1",
|
|
56
|
+
"@types/esquery": "^1.5.4",
|
|
57
|
+
"@types/estraverse": "^5.1.7",
|
|
58
|
+
"@typescript-eslint/visitor-keys": "^8.67.0",
|
|
59
|
+
"@typhonjs-build-test/esm-d-ts": "0.4.0",
|
|
60
|
+
"@typhonjs-typedoc/typedoc-pkg": "^0.4.2",
|
|
61
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
62
|
+
"@vitest/ui": "^4.1.11",
|
|
63
|
+
"@webcoder49/code-input": "^2.8.3",
|
|
64
|
+
"eslint": "^10.9.0",
|
|
65
|
+
"eslint-config-ash-nazg": "42.6.0",
|
|
66
|
+
"eslint-plugin-jsdoc": "^64.2.1",
|
|
67
|
+
"espree": "^11.2.0",
|
|
68
|
+
"estraverse": "^5.3.0",
|
|
69
|
+
"prismjs": "^1.30.0",
|
|
70
|
+
"typedoc": "^0.28.20",
|
|
71
|
+
"typescript": "^5.9.3",
|
|
72
|
+
"typescript-eslint": "^8.67.0",
|
|
73
|
+
"vitest": "^4.1.11"
|
|
74
|
+
},
|
|
75
|
+
"files": [
|
|
76
|
+
"/dist",
|
|
77
|
+
"/src",
|
|
78
|
+
"CHANGES.md",
|
|
79
|
+
"LICENSE-MIT.txt",
|
|
80
|
+
"dist-cjser"
|
|
81
|
+
],
|
|
82
|
+
"scripts": {
|
|
83
|
+
"start": "static -p 8070",
|
|
84
|
+
"attw": "attw --pack . --profile esm-only",
|
|
85
|
+
"copy": "cp -R node_modules/prismjs/ demo/vendor/prismjs/ && cp -R node_modules/@webcoder49/code-input/ demo/vendor/@webcoder49/code-input/ && cp node_modules/esquery/dist/esquery.esm.js demo/vendor/esquery/dist/esquery.esm.js && cp -R node_modules/jsdoc-type-pratt-parser/dist demo/vendor/jsdoc-type-pratt-parser && cp -R node_modules/comment-parser/es6 demo/vendor/comment-parser",
|
|
86
|
+
"build": "npm run copy && npm run types",
|
|
87
|
+
"docs": "typedoc-pkg --api-link es",
|
|
88
|
+
"eslint": "eslint .",
|
|
89
|
+
"lint": "npm run eslint --",
|
|
90
|
+
"open": "open ./coverage/index.html",
|
|
91
|
+
"test": "npm run lint && npm run build && npm run test-cov",
|
|
92
|
+
"test-ui": "vitest --ui --coverage",
|
|
93
|
+
"test-cov": "vitest --coverage",
|
|
94
|
+
"tsc": "tsc",
|
|
95
|
+
"types": "esm-d-ts gen ./src/index.js --output ./dist/index.d.ts"
|
|
96
|
+
},
|
|
97
|
+
"main": "./dist-cjser/index.cjs",
|
|
98
|
+
"cjser": {
|
|
99
|
+
"sourceVersion": "0.96.0",
|
|
100
|
+
"cjserVersion": 2,
|
|
101
|
+
"original": {
|
|
102
|
+
"name": "@es-joy/jsdoccomment",
|
|
103
|
+
"version": "0.96.0",
|
|
104
|
+
"exports": {
|
|
105
|
+
".": {
|
|
106
|
+
"types": "./dist/index.d.ts",
|
|
107
|
+
"default": "./src/index.js"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"repository": {
|
|
111
|
+
"type": "git",
|
|
112
|
+
"url": "git+https://github.com/es-joy/jsdoccomment.git"
|
|
113
|
+
},
|
|
114
|
+
"dependencies": {
|
|
115
|
+
"@types/estree": "^1.0.9",
|
|
116
|
+
"@typescript-eslint/types": "^8.67.0",
|
|
117
|
+
"comment-parser": "1.4.8",
|
|
118
|
+
"esquery": "^1.7.0",
|
|
119
|
+
"jsdoc-type-pratt-parser": "~9.2.0"
|
|
120
|
+
},
|
|
121
|
+
"files": [
|
|
122
|
+
"/dist",
|
|
123
|
+
"/src",
|
|
124
|
+
"CHANGES.md",
|
|
125
|
+
"LICENSE-MIT.txt"
|
|
126
|
+
],
|
|
127
|
+
"scripts": {
|
|
128
|
+
"start": "static -p 8070",
|
|
129
|
+
"attw": "attw --pack . --profile esm-only",
|
|
130
|
+
"copy": "cp -R node_modules/prismjs/ demo/vendor/prismjs/ && cp -R node_modules/@webcoder49/code-input/ demo/vendor/@webcoder49/code-input/ && cp node_modules/esquery/dist/esquery.esm.js demo/vendor/esquery/dist/esquery.esm.js && cp -R node_modules/jsdoc-type-pratt-parser/dist demo/vendor/jsdoc-type-pratt-parser && cp -R node_modules/comment-parser/es6 demo/vendor/comment-parser",
|
|
131
|
+
"build": "npm run copy && npm run types",
|
|
132
|
+
"docs": "typedoc-pkg --api-link es",
|
|
133
|
+
"eslint": "eslint .",
|
|
134
|
+
"lint": "npm run eslint --",
|
|
135
|
+
"open": "open ./coverage/index.html",
|
|
136
|
+
"test": "npm run lint && npm run build && npm run test-cov",
|
|
137
|
+
"test-ui": "vitest --ui --coverage",
|
|
138
|
+
"test-cov": "vitest --coverage",
|
|
139
|
+
"tsc": "tsc",
|
|
140
|
+
"types": "esm-d-ts gen ./src/index.js --output ./dist/index.d.ts"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import esquery from 'esquery';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
visitorKeys as jsdocTypePrattParserVisitorKeys
|
|
5
|
+
} from '@cjser/jsdoc-type-pratt-parser';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
commentParserToESTree, jsdocVisitorKeys
|
|
9
|
+
} from './commentParserToESTree.js';
|
|
10
|
+
|
|
11
|
+
/* eslint-disable jsdoc/reject-any-type -- Arbitrary settings */
|
|
12
|
+
/**
|
|
13
|
+
* @param {{
|
|
14
|
+
* mode: import('@cjser/jsdoc-type-pratt-parser').ParseMode,
|
|
15
|
+
* [key: string]: any
|
|
16
|
+
* }} settings
|
|
17
|
+
* @param {import('./commentParserToESTree.js').
|
|
18
|
+
* CommentParserToESTreeOptions} [commentParserToESTreeOptions]
|
|
19
|
+
* @returns {import('./index.js').CommentHandler}
|
|
20
|
+
*/
|
|
21
|
+
const commentHandler = (settings, commentParserToESTreeOptions) => {
|
|
22
|
+
/* eslint-enable jsdoc/reject-any-type -- Arbitrary settings */
|
|
23
|
+
/**
|
|
24
|
+
* @type {import('./index.js').CommentHandler}
|
|
25
|
+
*/
|
|
26
|
+
return (commentSelector, jsdoc) => {
|
|
27
|
+
const {mode} = settings;
|
|
28
|
+
|
|
29
|
+
const selector = esquery.parse(commentSelector);
|
|
30
|
+
|
|
31
|
+
const ast = commentParserToESTree(
|
|
32
|
+
jsdoc, mode, commentParserToESTreeOptions
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const castAst = /** @type {unknown} */ (ast);
|
|
36
|
+
|
|
37
|
+
return esquery.matches(/** @type {import('estree').Node} */ (
|
|
38
|
+
castAst
|
|
39
|
+
), selector, undefined, {
|
|
40
|
+
visitorKeys: {
|
|
41
|
+
...jsdocTypePrattParserVisitorKeys,
|
|
42
|
+
...jsdocVisitorKeys
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export {commentHandler};
|