Skip to content

Commit 64cee2c

Browse files
committed
Stop ESLint from complaining about a "user-supplied" filename
When reading the config file, GitGitGadget accepts the file name as input variable. But this is still far from under the control of an attacker... ESLint cannot know that, so let's help it out here. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 8a673d9 commit 64cee2c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/project-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export async function loadConfig(file: string): Promise<IConfig> {
8080
const { default: newConfig } = (await import(file)) as importedConfig;
8181
loadedConfig = newConfig;
8282
} else {
83+
// eslint-disable-next-line security/detect-non-literal-fs-filename
8384
const fileText = fs.readFileSync(file, { encoding: "utf-8" });
8485
loadedConfig = JSON.parse(fileText) as IConfig;
8586
}

0 commit comments

Comments
 (0)