فهرست منبع

fix lint error

yuto-o 4 سال پیش
والد
کامیت
e6e6c45f7e
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  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 };