<commit_before>//
// Validates the JavaScript to prevent common errors. JSHint is a
// re-implementation of Douglas Crockford's JSLint with the goal of not
// forcing his opnions on the code. A complete list of rules is available on
// [jshint.com](http://www.jshint.com/docs/)

'use strict';

var
  fs   = require( 'fs' ),
  gulp = require( 'gulp' ),
  fewu = require( './setup' ),
  R    = require( 'ramda' ),

  getConfig = function() {
    var
      customRcPath = process.cwd() + '/' + fewu.config( 'jshintrc' ),

      jshintrc = JSON.parse( fs.readFileSync( __dirname + '/../.jshintrc' ) ),
      fileCustomRC = !fs.exists( customRcPath ) ?
        {} : JSON.parse( fs.readFileSync( customRcPath ) ),
      manualRC = fewu.config( 'jshintrc' ),

      config = R.reduce( R.merge, {}, [ jshintrc, fileCustomRC, manualRC ] );

    if ( fewu.config( 'esnext' ) ) {
      config.esnext = true;
      config.strict = false;
    }

    config.esnext = fewu.config( 'esnext' ) || config.esnext;

    return config;
  };

gulp.task( 'lint-node', function() {
  var
    jshint = require( 'gulp-jshint' ),

    files = fewu.files( 'node' ),
    config = getConfig();

  config.node = true;<commit_msg>fix specifying jshint config in gulp file<commit_after>//
// Validates the JavaScript to prevent common errors. JSHint is a
// re-implementation of Douglas Crockford's JSLint with the goal of not
// forcing his opnions on the code. A complete list of rules is available on
// [jshint.com](http://www.jshint.com/docs/)

'use strict';

var
  fs   = require( 'fs' ),
  gulp = require( 'gulp' ),
  fewu = require( './setup' ),
  R    = require( 'ramda' ),

  getConfig = function() {
    var
      customRcPath = process.cwd() + '/' + fewu.config( 'jshintrc' ),

      jshintrc = JSON.parse( fs.readFileSync( __dirname + '/../.jshintrc' ) ),
      fileCustomRC = !fs.existsSync( customRcPath ) ?
        {} : JSON.parse( fs.readFileSync( customRcPath ) ),
      manualRC = fewu.config( 'jshint' ),

      config = R.reduce( R.merge, {}, [ jshintrc, fileCustomRC, manualRC ] );

    if ( fewu.config( 'esnext' ) ) {
      config.esnext = true;
      config.strict = false;
    }

    config.esnext = fewu.config( 'esnext' ) || config.esnext;

    return config;
  };

gulp.task( 'lint-node', function() {
  var
    jshint = require( 'gulp-jshint' ),

    files = fewu.files( 'node' ),
    config = getConfig();

  config.node = true;
{'fraction_non_alphanumeric': 0.15581203627370158, 'fraction_numerical': 0.0, 'mean_word_length': 2.728110599078341, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2809881', 'n_tokens_mistral': 869, 'n_tokens_neox': 846, 'n_words': 215}