Check queries in initConfig

This commit is contained in:
Arthur Baars 2021-05-21 12:04:05 +02:00
parent 9aca271fbb
commit 84bec4d116
6 changed files with 33 additions and 29 deletions

View file

@ -162,7 +162,10 @@ export async function runQueries(
logger.startGroup(`Analyzing ${language}`);
const queries = config.queries[language];
if (queries.builtin.length === 0 && queries.custom.length === 0) {
if (
queries === undefined ||
(queries.builtin.length === 0 && queries.custom.length === 0)
) {
throw new Error(
`Unable to analyse ${language} as no queries were selected for this language`
);