yuto-o 4 лет назад
Родитель
Сommit
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';
 import { InstallerService } from '~/services/InstallerService';
 
 
 const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
 const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
-const fs = require('fs');
 
 
 @Controller('/')
 @Controller('/')
 export class TopCtrl {
 export class TopCtrl {
@@ -22,6 +21,8 @@ export class TopCtrl {
       scopes: requiredScopes,
       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;
     const growiBotVersion = JSON.parse(fs.readFileSync('../../package.json', 'utf8')).version;
 
 
     return { url, isOfficialMode, growiBotVersion };
     return { url, isOfficialMode, growiBotVersion };