Skip to content
Snippets Groups Projects
Select Git revision
  • 73bff104c91b1171fb78247fa0e33c7bbe874650
  • annotation-on-video default protected
  • demo_ci
  • 3-upstream-01022023
  • master
  • gh3538-captions
  • 16-adapt-for-images-annot
  • 15-api-for-annotations-on-video
  • 15-annotations-on-videos
  • video_for_annotations
  • wip-1-annotations-on-videos
  • 9-videoviewer-tests
  • 9_wip_videotests
  • 6-fix-tests-and-ci
  • _fix_ci
  • wip-webpack-from-git
16 results

container-lint.js

Blame
  • container-lint.js 747 B
    const glob = require('glob'); // eslint-disable-line import/no-extraneous-dependencies
    const fs = require('fs');
    const chalk = require('chalk'); // eslint-disable-line import/no-extraneous-dependencies
    
    const { error } = console;
    const globOpts = { cwd: 'src/containers' };
    const files = glob.sync('**/*.js', globOpts);
    
    files.forEach((fileName) => {
      const fileContent = fs.readFileSync(`src/containers/${fileName}`).toString();
      const withPlugins = fileContent.indexOf('withPlugins(');
      if (withPlugins > 0) {
        const correctCall = fileContent.indexOf(`withPlugins('${fileName.replace('.js', '')}')`);
        if (withPlugins !== correctCall) {
          error(chalk.red(`Check withPlugins for ${fileName} for an incorrect target`));
        }
      }
    });