ecmaVersion: 2020,
sourceType: 'module'
},
- plugins: ['@typescript-eslint', 'promise', 'prettierx'],
+ plugins: ['@typescript-eslint', 'promise', 'prettierx', 'jsdoc'],
extends: [
'standard',
'eslint:recommended',
]
},
overrides: [
+ {
+ files: ['src/**/*.ts'],
+ extends: 'plugin:jsdoc/recommended',
+ rules: {
+ 'jsdoc/no-types': 'error',
+ 'jsdoc/require-param-type': 'off',
+ 'jsdoc/require-returns-type': 'off'
+ }
+ },
{
files: ['*.js'],
extends: 'plugin:node/recommended',
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true
},
+ "comment-parser": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.1.2.tgz",
+ "integrity": "sha512-AOdq0i8ghZudnYv8RUnHrhTgafUGs61Rdz9jemU5x2lnZwAWyOq7vySo626K59e1fVKH1xSRorJwPVRLSWOoAQ==",
+ "dev": true
+ },
"commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
"dev": true
},
"electron-to-chromium": {
- "version": "1.3.663",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.663.tgz",
- "integrity": "sha512-xkVkzHj6k3oRRGlmdgUCCLSLhtFYHDCTH7SeK+LJdJjnsLcrdbpr8EYmfMQhez3V/KPO5UScSpzQ0feYX6Qoyw==",
+ "version": "1.3.664",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.664.tgz",
+ "integrity": "sha512-yb8LrTQXQnh9yhnaIHLk6CYugF/An50T20+X0h++hjjhVfgSp1DGoMSYycF8/aD5eiqS4QwaNhiduFvK8rifRg==",
"dev": true
},
"emoji-regex": {
}
}
},
+ "eslint-plugin-jsdoc": {
+ "version": "31.6.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-31.6.1.tgz",
+ "integrity": "sha512-5hCV3u+1VSEUMyfdTl+dpWsioD7tqQr2ILQw+KbXrF42AVxCLO8gnNLR6zDCDjqGGpt79V1sgY0RRchCWuCigg==",
+ "dev": true,
+ "requires": {
+ "comment-parser": "1.1.2",
+ "debug": "^4.3.1",
+ "jsdoctypeparser": "^9.0.0",
+ "lodash": "^4.17.20",
+ "regextras": "^0.7.1",
+ "semver": "^7.3.4",
+ "spdx-expression-parse": "^3.0.1"
+ }
+ },
"eslint-plugin-node": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
"dev": true
},
+ "jsdoctypeparser": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz",
+ "integrity": "sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==",
+ "dev": true
+ },
"jsesc": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
"unicode-match-property-value-ecmascript": "^1.2.0"
}
},
+ "regextras": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.7.1.tgz",
+ "integrity": "sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==",
+ "dev": true
+ },
"regjsgen": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz",
"eslint": "^7.20.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
+ "eslint-plugin-jsdoc": "^31.6.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettierx": "^0.17.1",
"eslint-plugin-promise": "^4.3.1",
* Choose a worker for the next task.
*
* The default implementation uses a round robin algorithm to distribute the load.
+ *
+ * @returns Worker.
*/
protected chooseWorker (): Worker {
this.nextWorker =
/**
* Creates a new worker for this pool and sets it up completely.
+ *
+ * @returns New, completely set up worker.
*/
protected internalNewWorker (): Worker {
const worker: Worker = this.newWorker()
* It will first check for and return an idle worker.
* If all workers are busy, then it will try to create a new one up to the `max` worker count.
* If the max worker count is reached, the emitter will emit a `FullPool` event and it will fall back to using a round robin algorithm to distribute the load.
+ *
+ * @returns Cluster worker.
*/
protected chooseWorker (): Worker {
let worker: Worker | undefined
* It will first check for and return an idle thread.
* If all threads are busy, then it will try to create a new one up to the `max` thread count.
* If the max thread count is reached, the emitter will emit a `FullPool` event and it will fall back to using a round robin algorithm to distribute the load.
+ *
+ * @returns Thread worker.
*/
protected chooseWorker (): ThreadWorkerWithMessageChannel {
let worker: ThreadWorkerWithMessageChannel | undefined
* Handle an error and convert it to a string so it can be sent back to the main worker.
*
* @param e The error raised by the worker.
+ * @returns Message of the error.
*/
protected handleError (e: Error | string): string {
return (e as unknown) as string