forbid stop global variable (#149)

This commit is contained in:
Dimitri POSTOLOV 2022-06-20 07:57:08 +02:00 committed by GitHub
parent 0d7c465659
commit c88242c4af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View file

@ -21,6 +21,7 @@ module.exports = {
plugins: ['@typescript-eslint', 'import', 'hive'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
'no-restricted-globals': ['error', 'stop'],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', ignoreRestSiblings: true }],
'no-empty': ['error', { allowEmptyCatch: true }],

View file

@ -50,7 +50,7 @@ async function main() {
registerShutdown({
logger: server.log,
async onShutdown() {
await Promise.all([stop(), server.close()]);
await Promise.all([ctx.stop(), server.close()]);
},
});

View file

@ -44,7 +44,7 @@ async function main() {
registerShutdown({
logger: server.log,
async onShutdown() {
await Promise.all([stop(), server.close()]);
await Promise.all([context.stop(), server.close()]);
},
});