const fs = require('fs');
const vm = require('vm');

try {
  const code = fs.readFileSync('./popup.js', 'utf8');
  vm.runInNewContext(code, { document: { addEventListener: () => {} } });
  console.log('No syntax errors found!');
} catch (error) {
  console.error('Syntax error found:', error.message);
  process.exit(1);
}