Yuki Takei 3 лет назад
Родитель
Сommit
b063398929
2 измененных файлов с 17 добавлено и 16 удалено
  1. 1 1
      packages/app/next.config.js
  2. 16 15
      packages/app/src/utils/next.config.utils.js

+ 1 - 1
packages/app/next.config.js

@@ -41,4 +41,4 @@ const nextConfig = {
 
 
 };
 };
 
 
-module.exports = withTM(nextConfig)
+module.exports = withTM(nextConfig);

+ 16 - 15
packages/app/src/utils/next.config.utils.js

@@ -1,31 +1,32 @@
 // workaround by https://github.com/martpie/next-transpile-modules/issues/143#issuecomment-817467144
 // workaround by https://github.com/martpie/next-transpile-modules/issues/143#issuecomment-817467144
 
 
-const path = require('path')
-const fs = require('fs')
+const fs = require('fs');
+const path = require('path');
 
 
-const node_modules = path.resolve(__dirname, '../../../../node_modules')
+const nodeModulesPath = path.resolve(__dirname, '../../../../node_modules');
 
 
 
 
+// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
 export const listScopedPackages = (scopes) => {
 export const listScopedPackages = (scopes) => {
-  const scopedPackages = []
+  const scopedPackages = [];
 
 
-  fs.readdirSync(node_modules)
-    .filter((name) => scopes.includes(name))
+  fs.readdirSync(nodeModulesPath)
+    .filter(name => scopes.includes(name))
     .forEach((scope) => {
     .forEach((scope) => {
-      fs.readdirSync(path.resolve(node_modules, scope))
-        .filter((name) => !name.startsWith('.'))
+      fs.readdirSync(path.resolve(nodeModulesPath, scope))
+        .filter(name => !name.startsWith('.'))
         .forEach((folderName) => {
         .forEach((folderName) => {
           const { name, ignoreTranspileModules } = require(path.resolve(
           const { name, ignoreTranspileModules } = require(path.resolve(
-            node_modules,
+            nodeModulesPath,
             scope,
             scope,
             folderName,
             folderName,
-            'package.json'
-          ))
+            'package.json',
+          ));
           if (!ignoreTranspileModules) {
           if (!ignoreTranspileModules) {
-            scopedPackages.push(name)
+            scopedPackages.push(name);
           }
           }
-        })
-    })
+        });
+    });
 
 
   return scopedPackages;
   return scopedPackages;
-}
+};