Simplify inferParser (#14438)

This commit is contained in:
fisker Cheung authored and GitHub committed 2023-03-03 15:52:44 +08:00
1 parent c79b3eec5e
commit a6dcfe9076
1 file changed
+1 -2
+1 -2
View File
@@ -1,10 +1,9 @@
import path from "node:path";
import { getSupportInfo } from "../main/support.js";
import getInterpreter from "../utils/get-interpreter.js";
function inferParser(filepath, plugins) {
const filename = path.basename(filepath).toLowerCase();
const { languages } = getSupportInfo({ plugins });
const languages = plugins.flatMap((plugin) => plugin.languages ?? []);
// If the file has no extension, we can try to infer the language from the
// interpreter in the shebang line, if any; but since this requires FS access,