<commit_before>
import Checker          from 'jscs'
import gutil            from 'gulp-util'
import * as configFile  from 'jscs/lib/cli-config'
import ConsoleReporter  from 'jscs/lib/reporters/console'
import through2         from 'through2'

function jscs() {
  let checker = new Checker({ esnext: true })
  checker.getConfiguration().registerDefaultRules()
  checker.configure(configFile.load())
  return through2.obj(function(file, _encoding, callback) {
    void _encoding
    checker.checkFile(file.path)
    .then(function(result) {
      file.jscs = result
      callback(null, file)
    })
    .catch(function(e) {
      callback(e)
    })<commit_msg>refactor(tasks/support/jscs): use prfun to make code simpler<commit_after>
import Checker          from 'jscs'
import gutil            from 'gulp-util'
import * as configFile  from 'jscs/lib/cli-config'
import ConsoleReporter  from 'jscs/lib/reporters/console'
import through2         from 'through2'

function jscs() {
  let checker = new Checker({ esnext: true })
  checker.getConfiguration().registerDefaultRules()
  checker.configure(configFile.load())
  return through2.obj(function(file, _encoding, callback) {
    void _encoding
    Promise.resolve(checker.checkFile(file.path))
    .then(function(result) {
      file.jscs = result
      return file
    })
    .nodify(callback)
{'fraction_non_alphanumeric': 0.10929368029739776, 'fraction_numerical': 0.0044609665427509295, 'mean_word_length': 3.442244224422442, 'pattern_counts': {'":': 0, '<': 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': '4401801', 'n_tokens_mistral': 429, 'n_tokens_neox': 426, 'n_words': 97}