<commit_before>const log = require('loglevel');
const path = require('path');
const fs = require('fs');
const chalk = require('chalk');
const process = require('process');
const addSkipped = require('./rules-util.js').addSkipped;
const processRules = require('./rules-util.js').processRules;
const semver = require('semver');

const rulesConf = {
    name: 'package.json',
    rules: [
        {
            desc: 'using public npm version of gfp eslint config',
            errorMsg:
                'remove "gfp-eslint-config" from package.json and run "npm install --save-dev eslint eslint-config-gfp"',
            fn: notUsingStashGfpEslintConfig
        },
        {
            desc: 'using eslint-config-gfp',
            errorMsg: 'run "npm install --save-dev eslint-config-gfp"',
            fn: missingEslintConfigGfp
        },
        {
            desc: 'using public npm version of angular-module-no-deps',
            errorMsg:
                'remove "angular-module-no-deps" from package.json and run \n "npm install --save-dev angular-module-no-deps"',
            fn: notUsingStashAngularModuleNoDeps
        },
        {
            desc: 'using documentationjs',
            errorMsg:
                'should be using documentationjs to generate JSDoc to README: \n "npm install --save-dev documentation" \n' +
                'then add scripts: \n' +
                '"docs": "npm run docs:md",\n' +
                '"docs:md": "documentation readme <source files>.js --section \'API\'"',
            fn: usingDocumentationJs
        },
        {
            desc: 'has npm script lint',
            errorMsg:
                'should have a npm script lint\n' +
                'then add script: \n' +
                '"lint": "eslint *.js"',
            fn: hasNpmLintScript
        },
        {
            desc: 'should be using babel-cli',
            errorMsg: 'run:\n' + 'npm install --save-dev babel-cli' + '\n',
            fn: shouldUseBabelCli
        },
        {
            desc: 'should be using babel-core',
            errorMsg: 'run:\n' + 'npm install --save-dev babel-core' + '\n',
            fn: shouldUseBabelCore
        },
        {
            desc: 'should be using babel-loader',
            errorMsg: 'run:\n' + 'npm install --save-dev babel-loader' + '\n',
            fn: shouldUseBabelLoader
        },
        {
            desc: 'should be using babel-plugin-istanbul',
            errorMsg:
                'run:\n' +
                'npm install --save-dev babel-plugin-istanbul' +
                '\n',
            fn: shouldUseBabelInstanbul
        },
        {
            desc: 'should be using babel-plugin-transform-runtime',
            errorMsg:
                'run:\n' +
                'npm install --save-dev babel-plugin-transform-runtime' +
                '\n',
            fn: shouldUseBabelTransformRuntime
        },
        {
            desc: 'should be using babel-preset-env',
            errorMsg:
                'run:\n' + 'npm install --save-dev babel-preset-env' + '\n',
            fn: shouldUseBabelPresetEnv
        },
        {
            desc: 'should be using puppeteer',
            errorMsg:
                'remove phantomjs from package.json, then run \n' +
                'npm install --save-dev puppeteer',
            fn: shouldUsePuppeteer
        },
        {
            desc: 'should be using headless Chrome',
            errorMsg:
                'remove "karma-phantomjs-launcher", then run \n' +
                'npm install --save-dev karma-chrome-launcher',
            fn: shouldUseChromeLauncher
        },
        {
            desc: 'should use prepush hooks',
            errorMsg:
                'run:\n' +
                'npm install --save-dev husky\n' +
                'then add the following to npm scripts:\n' +
                '"prepush": "npm run lint && karma start --single-run"',
            fn: shouldUsePrepushHooks
        },
        {
            desc: 'should use public require-polyfill',
            errorMsg:
                'remove require-polyfill from package.json, then run \n' +
                'npm install --save-dev require-polyfill\n',
            fn: shouldUsePublicRequirePolyfill
        },
        {
            desc: 'should use eslint-config-gfp 3.0.0 and up',
            errorMsg:
                'set eslint-config-gfp to use version "^3.0.0" in package.json',
            fn: shouldUseEslintConfigGfp300
        },
        {
            desc: 'should have gfp-doctor >1.9 installed',
            errorMsg: 'run:\n' + 'npm install --save-dev gfp-doctor',
            fn: shouldUseGfpDoctor
        },
        {
            desc: 'should run gfp-doctor after install',
            errorMsg:
                'add the following to npm scripts:\n' +
                '"postinstall": "gfp-doctor"',
            fn: shouldRunGfpDoctorPostInstall
        },
        {
            desc: 'should use "karma" 1.7.0 and up',
            errorMsg: 'set "karma" to use "^1.7.0"',
            fn: shouldUseKarma170
        },
        {
            desc: 'should use "karma-coverage" 1.1.0 and up',
            errorMsg: 'set "karma-coverage" to use "^1.1.0"',
            fn: shouldUseKarmaCoverage110
        },
        {
            desc: 'should use "karma-jasmine" 1.1.0 and up',
            errorMsg: 'set "karma-coverage" to use "^1.1.0"',
            fn: shouldUseKarmaJasmine110
        }
    ]
};

module.exports = function(options) {
    'use strict';
    const packagePath = path.join(
        process.cwd(),
        options.packagePath || 'package.json'
    );<commit_msg>fix typo of incorrect npm package<commit_after>const log = require('loglevel');
const path = require('path');
const fs = require('fs');
const chalk = require('chalk');
const process = require('process');
const addSkipped = require('./rules-util.js').addSkipped;
const processRules = require('./rules-util.js').processRules;
const semver = require('semver');

const rulesConf = {
    name: 'package.json',
    rules: [
        {
            desc: 'using public npm version of gfp eslint config',
            errorMsg:
                'remove "gfp-eslint-config" from package.json and run "npm install --save-dev eslint eslint-config-gfp"',
            fn: notUsingStashGfpEslintConfig
        },
        {
            desc: 'using eslint-config-gfp',
            errorMsg: 'run "npm install --save-dev eslint-config-gfp"',
            fn: missingEslintConfigGfp
        },
        {
            desc: 'using public npm version of angular-module-no-deps',
            errorMsg:
                'remove "angular-module-no-deps" from package.json and run \n "npm install --save-dev angular-module-no-deps"',
            fn: notUsingStashAngularModuleNoDeps
        },
        {
            desc: 'using documentationjs',
            errorMsg:
                'should be using documentationjs to generate JSDoc to README: \n "npm install --save-dev documentation" \n' +
                'then add scripts: \n' +
                '"docs": "npm run docs:md",\n' +
                '"docs:md": "documentation readme <source files>.js --section \'API\'"',
            fn: usingDocumentationJs
        },
        {
            desc: 'has npm script lint',
            errorMsg:
                'should have a npm script lint\n' +
                'then add script: \n' +
                '"lint": "eslint *.js"',
            fn: hasNpmLintScript
        },
        {
            desc: 'should be using babel-cli',
            errorMsg: 'run:\n' + 'npm install --save-dev babel-cli' + '\n',
            fn: shouldUseBabelCli
        },
        {
            desc: 'should be using babel-core',
            errorMsg: 'run:\n' + 'npm install --save-dev babel-core' + '\n',
            fn: shouldUseBabelCore
        },
        {
            desc: 'should be using babel-loader',
            errorMsg: 'run:\n' + 'npm install --save-dev babel-loader' + '\n',
            fn: shouldUseBabelLoader
        },
        {
            desc: 'should be using babel-plugin-istanbul',
            errorMsg:
                'run:\n' +
                'npm install --save-dev babel-plugin-istanbul' +
                '\n',
            fn: shouldUseBabelInstanbul
        },
        {
            desc: 'should be using babel-plugin-transform-runtime',
            errorMsg:
                'run:\n' +
                'npm install --save-dev babel-plugin-transform-runtime' +
                '\n',
            fn: shouldUseBabelTransformRuntime
        },
        {
            desc: 'should be using babel-preset-env',
            errorMsg:
                'run:\n' + 'npm install --save-dev babel-preset-env' + '\n',
            fn: shouldUseBabelPresetEnv
        },
        {
            desc: 'should be using puppeteer',
            errorMsg:
                'remove phantomjs from package.json, then run \n' +
                'npm install --save-dev puppeteer',
            fn: shouldUsePuppeteer
        },
        {
            desc: 'should be using headless Chrome',
            errorMsg:
                'remove "karma-phantomjs-launcher", then run \n' +
                'npm install --save-dev karma-chrome-launcher',
            fn: shouldUseChromeLauncher
        },
        {
            desc: 'should use prepush hooks',
            errorMsg:
                'run:\n' +
                'npm install --save-dev husky\n' +
                'then add the following to npm scripts:\n' +
                '"prepush": "npm run lint && karma start --single-run"',
            fn: shouldUsePrepushHooks
        },
        {
            desc: 'should use public require-polyfill',
            errorMsg:
                'remove require-polyfill from package.json, then run \n' +
                'npm install --save-dev require-polyfill\n',
            fn: shouldUsePublicRequirePolyfill
        },
        {
            desc: 'should use eslint-config-gfp 3.0.0 and up',
            errorMsg:
                'set eslint-config-gfp to use version "^3.0.0" in package.json',
            fn: shouldUseEslintConfigGfp300
        },
        {
            desc: 'should have gfp-doctor >1.9 installed',
            errorMsg: 'run:\n' + 'npm install --save-dev gfp-doctor',
            fn: shouldUseGfpDoctor
        },
        {
            desc: 'should run gfp-doctor after install',
            errorMsg:
                'add the following to npm scripts:\n' +
                '"postinstall": "gfp-doctor"',
            fn: shouldRunGfpDoctorPostInstall
        },
        {
            desc: 'should use "karma" 1.7.0 and up',
            errorMsg: 'set "karma" to use "^1.7.0"',
            fn: shouldUseKarma170
        },
        {
            desc: 'should use "karma-coverage" 1.1.0 and up',
            errorMsg: 'set "karma-coverage" to use "^1.1.0"',
            fn: shouldUseKarmaCoverage110
        },
        {
            desc: 'should use "karma-jasmine" 1.1.0 and up',
            errorMsg: 'set "karma-jasmine" to use "^1.1.0"',
            fn: shouldUseKarmaJasmine110
        }
    ]
};

module.exports = function(options) {
    'use strict';
    const packagePath = path.join(
        process.cwd(),
        options.packagePath || 'package.json'
    );
{'fraction_non_alphanumeric': 0.1192864116446259, 'fraction_numerical': 0.006745362563237774, 'mean_word_length': 1.4775725593667546, 'pattern_counts': {'":': 10, '<': 5, '<?xml version=': 0, '>': 7, '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': '1642983', 'n_tokens_mistral': 3377, 'n_tokens_neox': 3200, 'n_words': 829}