eslint-plugin-jsdoc 55.0.2 → 55.0.4
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/dist/generateDocs.cjs +217 -0
- package/dist/generateDocs.cjs.map +1 -0
- package/dist/index-cjs.cjs +1 -1
- package/dist/index-cjs.cjs.map +1 -1
- package/dist/index-esm.cjs +59 -0
- package/dist/index-esm.cjs.map +1 -0
- package/dist/index.cjs +406 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +16 -7
- package/dist/index.d.ts.map +1 -1
- package/package.json +16 -9
- package/src/index-cjs.js +1 -1
- package/src/index-esm.js +75 -0
- package/src/index.js +530 -7
package/package.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"description": "JSDoc linting rules for ESLint.",
|
|
21
21
|
"devDependencies": {
|
|
22
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
22
23
|
"@babel/cli": "^7.28.3",
|
|
23
24
|
"@babel/core": "^7.28.4",
|
|
24
25
|
"@babel/eslint-parser": "^7.28.4",
|
|
@@ -83,19 +84,24 @@
|
|
|
83
84
|
"types": "./dist/index.d.ts",
|
|
84
85
|
"exports": {
|
|
85
86
|
".": {
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
"import": {
|
|
88
|
+
"types": "./dist/index.d.ts",
|
|
89
|
+
"default": "./src/index.js"
|
|
90
|
+
},
|
|
91
|
+
"require": {
|
|
92
|
+
"types": "./dist/index-cjs.d.ts",
|
|
93
|
+
"default": "./dist/index-cjs.cjs"
|
|
94
|
+
}
|
|
89
95
|
},
|
|
90
96
|
"./getJsdocProcessorPlugin.js": {
|
|
91
97
|
"types": "./dist/getJsdocProcessorPlugin.d.ts",
|
|
92
|
-
"import": "./
|
|
93
|
-
"require": "./
|
|
98
|
+
"import": "./src/getJsdocProcessorPlugin.js",
|
|
99
|
+
"require": "./dist/getJsdocProcessorPlugin.cjs"
|
|
94
100
|
},
|
|
95
101
|
"./iterateJsdoc.js": {
|
|
96
102
|
"types": "./dist/iterateJsdoc.d.ts",
|
|
97
|
-
"import": "./
|
|
98
|
-
"require": "./
|
|
103
|
+
"import": "./src/iterateJsdoc.js",
|
|
104
|
+
"require": "./dist/iterateJsdoc.cjs"
|
|
99
105
|
}
|
|
100
106
|
},
|
|
101
107
|
"name": "eslint-plugin-jsdoc",
|
|
@@ -137,7 +143,8 @@
|
|
|
137
143
|
"scripts": {
|
|
138
144
|
"tsc": "tsc",
|
|
139
145
|
"tsc-build": "tsc -p tsconfig-prod.json",
|
|
140
|
-
"build": "rimraf ./dist && NODE_ENV=production babel ./src --out-file-extension .cjs --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored && replace 'require\\(\"\\.(.*?)\\.[^.]*?\"\\)' 'require(\".$1.cjs\")' 'dist' -r --include=\"*.cjs\" && pnpm tsc-build",
|
|
146
|
+
"build": "node ./src/bin/buildEntryFileForTS.js && rimraf ./dist && NODE_ENV=production babel ./src --out-file-extension .cjs --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored && replace 'require\\(\"\\.(.*?)\\.[^.]*?\"\\)' 'require(\".$1.cjs\")' 'dist' -r --include=\"*.cjs\" && pnpm tsc-build",
|
|
147
|
+
"attw": "attw --pack .",
|
|
141
148
|
"check-docs": "node ./src/bin/generateDocs.js --check",
|
|
142
149
|
"create-docs": "pnpm run create-options && node ./src/bin/generateDocs.js",
|
|
143
150
|
"create-rule": "node ./src/bin/generateRule.js",
|
|
@@ -151,5 +158,5 @@
|
|
|
151
158
|
"test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
|
|
152
159
|
"test-index": "pnpm run test-no-cov test/rules/index.js"
|
|
153
160
|
},
|
|
154
|
-
"version": "55.0.
|
|
161
|
+
"version": "55.0.4"
|
|
155
162
|
}
|
package/src/index-cjs.js
CHANGED
package/src/index-esm.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* eslint-disable perfectionist/sort-imports -- For auto-generate; Do not remove */
|
|
2
|
+
import {
|
|
3
|
+
merge,
|
|
4
|
+
} from 'object-deep-merge';
|
|
5
|
+
|
|
6
|
+
// BEGIN REPLACE
|
|
7
|
+
import index from './index-cjs.js';
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line unicorn/prefer-export-from --- Reusing `index`
|
|
10
|
+
export default index;
|
|
11
|
+
// END REPLACE
|
|
12
|
+
|
|
13
|
+
/* eslint-disable jsdoc/valid-types -- Bug */
|
|
14
|
+
/**
|
|
15
|
+
* @type {((
|
|
16
|
+
* cfg?: {
|
|
17
|
+
* mergeSettings?: boolean,
|
|
18
|
+
* config?: `flat/${import('./index-cjs.js').ConfigGroups}${import('./index-cjs.js').ConfigVariants}${import('./index-cjs.js').ErrorLevelVariants}`,
|
|
19
|
+
* settings?: Partial<import('./iterateJsdoc.js').Settings>
|
|
20
|
+
* }
|
|
21
|
+
* ) => import('eslint').Linter.Config)}
|
|
22
|
+
*/
|
|
23
|
+
/* eslint-enable jsdoc/valid-types -- Bug */
|
|
24
|
+
export const jsdoc = function (cfg) {
|
|
25
|
+
/** @type {import('eslint').Linter.Config} */
|
|
26
|
+
let outputConfig = {
|
|
27
|
+
plugins: {
|
|
28
|
+
jsdoc: index,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
if (
|
|
32
|
+
cfg?.config
|
|
33
|
+
) {
|
|
34
|
+
// @ts-expect-error Security check
|
|
35
|
+
if (cfg.config === '__proto__') {
|
|
36
|
+
throw new TypeError('Disallowed config value');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
outputConfig = index.configs[cfg.config];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
outputConfig.settings = {
|
|
43
|
+
jsdoc: cfg?.mergeSettings === false ?
|
|
44
|
+
cfg.settings :
|
|
45
|
+
merge(
|
|
46
|
+
{},
|
|
47
|
+
cfg?.settings ?? {},
|
|
48
|
+
cfg?.config?.includes('recommended') ?
|
|
49
|
+
{
|
|
50
|
+
// We may need to drop these for "typescript" (non-"flavor") configs,
|
|
51
|
+
// if support is later added: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html
|
|
52
|
+
structuredTags: {
|
|
53
|
+
next: {
|
|
54
|
+
required: [
|
|
55
|
+
'type',
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
throws: {
|
|
59
|
+
required: [
|
|
60
|
+
'type',
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
yields: {
|
|
64
|
+
required: [
|
|
65
|
+
'type',
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
} :
|
|
70
|
+
{},
|
|
71
|
+
),
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return outputConfig;
|
|
75
|
+
};
|