diff --git a/.lintstagedrc.cjs b/.lintstagedrc.cjs index ec8bd4f..e9aca4d 100644 --- a/.lintstagedrc.cjs +++ b/.lintstagedrc.cjs @@ -10,4 +10,15 @@ module.exports = { } return commands; }, + './**/migration.sql': (files) => { + for (const file of files) { + const content = fs.readFileSync(file, 'utf-8'); + if (content.includes('Warnings:')) { + return [ + `!!! Migration SQL file (${path.relative('', file)}) contains warnings !!! Solve the warnings and commit again.`, + ]; + } + } + return []; + }, };