<commit_before>"use strict";

const fs = require('fs');
const path = require('path');

function fileExists(path) {
    return fs.existsSync(path);
}

module.exports = function (webpackConfig) {
    const eslintrcPath = path.join(webpackConfig.context, '.eslintrc');

    return {
        configFile: fileExists(eslintrcPath) ? eslintrcPath : path.join(__dirname, '../.eslintrc'),
        // 报warning了就终止webpack编译
        failOnWarning: true,
        // 报error了就终止webpack编译
        failOnError: true,
        // 开启eslint的cache，cache存在node_modules/.cache目录里
        cache: false
    }
};<commit_msg>refactor: improve aslant config<commit_after>"use strict";

const fs = require('fs');
const path = require('path');

function fileExists(path) {
    return fs.existsSync(path);
}

module.exports = function (webpackConfig) {
    const eslintrcPath = path.join(webpackConfig.context, '.eslintrc');

    return {
        configFile: fileExists(eslintrcPath) ? eslintrcPath : path.join(__dirname, '../.eslintrc'),
        // 报warning了就终止webpack编译
        failOnWarning: false,
        // 报error了就终止webpack编译
        failOnError: true,
        // 开启eslint的cache，cache存在node_modules/.cache目录里
        cache: false
    }
};
{'fraction_non_alphanumeric': 0.12448474855729597, 'fraction_numerical': 0.0, 'mean_word_length': 3.2152777777777777, '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': '2317011', 'n_tokens_mistral': 404, 'n_tokens_neox': 415, 'n_words': 71}