<commit_before>const gulp = require('gulp');
const eslint = require('gulp-eslint');
const yargs = require('yargs');
const PluginError = require('gulp-util').PluginError;

var argv = yargs.argv;

export default function(opts) {
  var options = opts || {};

  var errorThreshold = options.eslintThreshold || 0;
  var path = options.path || 'src/**/!(__spec__|definition).js';

  var eslintTask = gulp.src([path], { base: process.cwd() })
    .pipe(eslint({
      configFile:  process.cwd() + '/.eslintrc'
    }))
    .pipe(eslint.format());
<commit_msg>add eslint file check<commit_after>const gulp = require('gulp');
const eslint = require('gulp-eslint');
const yargs = require('yargs');
const PluginError = require('gulp-util').PluginError;
const gutil = require('gulp-util');
const fs = require('fs');

var argv = yargs.argv;

export default function(opts) {
  var options = opts || {};

  var errorThreshold = options.eslintThreshold || 0;
  var path = options.path || 'src/**/!(__spec__|definition).js';

  fs.stat(process.cwd() + '/.eslintrc', function(err, stat) {
    if (err == null) { return }
    if (err.code == 'ENOENT') {
      gutil.log(gutil.colors.red("Cannot find '.eslintrc' file"));
      gutil.log(gutil.colors.white("Create an '.eslintrc' file in the root of your project and add the following code:\n{\n  \"extends\": \"./node_modules/carbon-factory/.eslintrc\"\n}"));
      process.exit();
    }
  });

  var eslintTask = gulp.src([path], { base: process.cwd() })
    .pipe(eslint({
      configFile:  process.cwd() + '/.eslintrc'
    }))
    .pipe(eslint.format());

{'fraction_non_alphanumeric': 0.1856513530522341, 'fraction_numerical': 0.0012586532410320957, 'mean_word_length': 3.847560975609756, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2080658', 'n_tokens_mistral': 550, 'n_tokens_neox': 531, 'n_words': 120}