diff --git a/scripts/jison/lint.mts b/scripts/jison/lint.mts index 95edd4fb1..596ce308b 100644 --- a/scripts/jison/lint.mts +++ b/scripts/jison/lint.mts @@ -14,12 +14,17 @@ const lint = async (file: string): Promise => { console.log(`Linting ${file}`); const jisonCode = await readFile(file, 'utf8'); // @ts-ignore no typings - const jsCode = new jison.Generator(jisonCode, { moduleType: 'amd' }).generate(); + const generator = new jison.Generator(jisonCode, { moduleType: 'amd' }); + const jsCode = generator.generate(); const [result] = await linter.lintText(jsCode); if (result.errorCount > 0) { console.error(`Linting failed for ${file}`); console.error(result.messages); } + if (generator.conflicts > 0) { + console.error(`Linting failed for ${file}. Conflicts found in grammar`); + return false; + } return result.errorCount === 0; };