Skip to content

Commit b819d18

Browse files
committed
Use require instead of eval
1 parent 7913f4c commit b819d18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

node/playwright-wrapper/playwright-state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export async function initializeExtension(
9696
state: PlaywrightState,
9797
): Promise<Response.Keywords> {
9898
logger.info(`Initializing extension: ${request.getPath()}`);
99-
const extension: Record<string, (...args: unknown[]) => unknown> = eval('require')(request.getPath());
99+
const extension: Record<string, (...args: unknown[]) => unknown> = require(request.getPath()); // eslint-disable-line
100100
state.extensions.push(extension);
101101
const kws = Object.keys(extension).filter((key) => extension[key] instanceof Function && !key.startsWith('__'));
102102
logger.info(`Adding ${kws.length} keywords from JS Extension`);
@@ -1140,7 +1140,7 @@ async function _saveCoverageReport(activeIndexedPage: IndexedPage): Promise<Resp
11401140
let mergedOptions: CoverageReportOptions;
11411141
if (fs.existsSync(configFile)) {
11421142
logger.info({ 'Config file exists: ': configFile });
1143-
const configFileModule = await eval('require')(configFile);
1143+
const configFileModule = require(configFile); // eslint-disable-line
11441144
mergedOptions = { ...configFileModule, ...options };
11451145
console.log({ 'Merged options: ': mergedOptions });
11461146
} else {

0 commit comments

Comments
 (0)