Explorar o código

fix lint error

yuto-o %!s(int64=4) %!d(string=hai) anos
pai
achega
e6e6c45f7e
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      packages/slackbot-proxy/src/controllers/top.ts

+ 2 - 1
packages/slackbot-proxy/src/controllers/top.ts

@@ -6,7 +6,6 @@ import { requiredScopes } from '@growi/slack';
 import { InstallerService } from '~/services/InstallerService';
 
 const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
-const fs = require('fs');
 
 @Controller('/')
 export class TopCtrl {
@@ -22,6 +21,8 @@ export class TopCtrl {
       scopes: requiredScopes,
     });
 
+    // use await import in order to avoid typescript-eslint error
+    const fs = await import('fs');
     const growiBotVersion = JSON.parse(fs.readFileSync('../../package.json', 'utf8')).version;
 
     return { url, isOfficialMode, growiBotVersion };