node: true,
mocha: true
},
- parserOptions: {
- ecmaVersion: 2020,
- sourceType: 'module'
- },
plugins: ['promise', 'prettierx', 'jsdoc', 'spellcheck'],
extends: [
'standard',
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
+ parserOptions: {
+ ecmaVersion: 2020,
+ sourceType: 'module',
+ project: './tsconfig.json'
+ },
plugins: ['@typescript-eslint'],
extends: [
+ 'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/typescript'
],
rules: {
this,
() => {
const workerCreated = this.createAndSetupWorker()
- this.registerWorkerMessageListener(workerCreated, async message => {
+ this.registerWorkerMessageListener(workerCreated, message => {
const tasksInProgress = this.tasks.get(workerCreated)
if (
isKillBehavior(KillBehaviors.HARD, message.kill) ||
tasksInProgress === 0
) {
// Kill received from the worker, means that no new tasks are submitted to that worker for a while ( > maxInactiveTime)
- await this.destroyWorker(workerCreated)
+ this.destroyWorker(workerCreated) as void
}
})
return workerCreated
return new LessRecentlyUsedWorkerChoiceStrategy(pool)
default:
throw new Error(
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`Worker choice strategy '${workerChoiceStrategy}' not found`
)
}
return null
})
.catch(e => {
- const err = this.handleError(e)
+ const err = this.handleError(e as Error)
this.sendToMainWorker({ error: err, id: value.id })
})
.finally(() => {