<commit_before>/* eslint-disable import/no-extraneous-dependencies, no-console */
import { resolve } from 'path';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import { HotModuleReplacementPlugin, DefinePlugin } from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';

export const basePath = resolve(`${__dirname}/notaperiod`);
export const distributionAppPath = resolve(`${__dirname}/dist/notaperiod`);

export default function (options = {}) {
  const environment = options.prod ? 'production' : 'dev';

  console.log(`=> Building notaperiod for '${environment}' environment.`);

  return ({
    entry: [
      'react-hot-loader/patch',
      'webpack-dev-server/client?http://localhost:8080',
      'webpack/hot/only-dev-server',
      basePath,
    ],
    devServer: { inline: true },
    output: {
      path: distributionAppPath,
      filename: 'app.js',
    },
    module: {
      loaders: [
        {
          test: /\.css$/,
          loaders: ['style', 'css'],
        },
        {
          test: /\.js$/,
          exclude: /(node_modules)/,
          loader: 'babel',
        },
      ],
    },
    plugins: [
      new CopyWebpackPlugin([{ from: `${basePath}/designs`, to: `${distributionAppPath}/designs` }]),
      new DefinePlugin({
        'process.env': {
          NODE_ENV: JSON.stringify(environment),
        },
      }),
      new HotModuleReplacementPlugin(),
      new HtmlWebpackPlugin({
        template: `${basePath}/template/index.html`,
      }),
    ],
    devtool: environment === 'dev' ? 'cheap-module-eval-source-map' : 'hidden-source-map',
  });
}
<commit_msg>Added eslint-loader to webpack workflow to enforce code validity and quality<commit_after>/* eslint-disable import/no-extraneous-dependencies, no-console */
import { resolve } from 'path';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import { HotModuleReplacementPlugin, DefinePlugin } from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';

export const basePath = resolve(`${__dirname}/notaperiod`);
export const distributionAppPath = resolve(`${__dirname}/dist/notaperiod`);

export default function (options = {}) {
  const environment = options.prod ? 'production' : 'dev';

  console.log(`=> Building notaperiod for '${environment}' environment.`);

  return ({
    entry: [
      'react-hot-loader/patch',
      'webpack-dev-server/client?http://localhost:8080',
      'webpack/hot/only-dev-server',
      basePath,
    ],
    devServer: { inline: true },
    output: {
      path: distributionAppPath,
      filename: 'app.js',
    },
    module: {
      loaders: [
        {
          test: /\.css$/,
          loaders: ['style', 'css'],
        },
        {
          test: /\.js$/,
          exclude: /(node_modules)/,
          loader: ['babel', 'eslint'],
        },
      ],
    },
    plugins: [
      new CopyWebpackPlugin([{ from: `${basePath}/designs`, to: `${distributionAppPath}/designs` }]),
      new DefinePlugin({
        'process.env': {
          NODE_ENV: JSON.stringify(environment),
        },
      }),
      new HotModuleReplacementPlugin(),
      new HtmlWebpackPlugin({
        template: `${basePath}/template/index.html`,
      }),
    ],
    devtool: environment === 'dev' ? 'cheap-module-eval-source-map' : 'hidden-source-map',
  });
}

{'fraction_non_alphanumeric': 0.15997585270147902, 'fraction_numerical': 0.0024147298520977964, 'mean_word_length': 2.719416386083053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4085976', 'n_tokens_mistral': 987, 'n_tokens_neox': 978, 'n_words': 199}