chore: fix linting issues

This commit is contained in:
Ben Heidemann 2021-03-21 13:51:53 +00:00
parent 4858694eb0
commit 57dc4e9481
2 changed files with 54 additions and 54 deletions

View File

@ -3,6 +3,6 @@ var mocha = require('mocha');
mocha.setup('bdd').timeout(10000).slow(250); mocha.setup('bdd').timeout(10000).slow(250);
window.onload = function() { window.onload = function() {
mocha.checkLeaks(); mocha.checkLeaks();
mocha.run(); mocha.run();
}; };

View File

@ -1,61 +1,61 @@
const webpack = require('webpack'); const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin"); const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path'); const path = require('path');
module.exports = env => ({ module.exports = env => ({
mode: 'development', mode: 'development',
entry: path.resolve(__dirname, './webpack-tests.js'), entry: path.resolve(__dirname, './webpack-tests.js'),
resolve: { resolve: {
alias: { alias: {
'fsProvider': path.resolve(__dirname, '../shims/providers/default'), 'fsProvider': path.resolve(__dirname, '../shims/providers/default'),
},
}, },
output: { },
path: path.resolve(__dirname, './dist-webpack'), output: {
filename: 'index.js', path: path.resolve(__dirname, './dist-webpack'),
}, filename: 'index.js',
plugins: [ },
new webpack.ContextReplacementPlugin( plugins: [
// Mocha safely uses require in such a way that webpack cannot statically extract dependancies. new webpack.ContextReplacementPlugin(
// If the ignoreRequestDependancyExpressionWarnings env is set, we will aggregate these warnings // Mocha safely uses require in such a way that webpack cannot statically extract dependancies.
// into one summary warning to minimise spamming the console. // If the ignoreRequestDependancyExpressionWarnings env is set, we will aggregate these warnings
/\/node_modules\/mocha\/lib/, // into one summary warning to minimise spamming the console.
(data) => { /\/node_modules\/mocha\/lib/,
if (env.ignoreRequestDependancyExpressionWarnings) { (data) => {
let requestDependencyExpressionsIgnored = 0; if (env.ignoreRequestDependancyExpressionWarnings) {
data.dependencies.forEach((dependancy) => { let requestDependencyExpressionsIgnored = 0;
if (dependancy.critical === 'the request of a dependency is an expression') { data.dependencies.forEach((dependancy) => {
dependancy.critical = undefined; if (dependancy.critical === 'the request of a dependency is an expression') {
requestDependencyExpressionsIgnored += 1; dependancy.critical = undefined;
} requestDependencyExpressionsIgnored += 1;
}); }
console.log(`WARNING: Ignoring ${requestDependencyExpressionsIgnored} "request of a dependency is an expression" warnings from "node_modules/mocha/lib".`); });
} console.log(`WARNING: Ignoring ${requestDependencyExpressionsIgnored} "request of a dependency is an expression" warnings from "node_modules/mocha/lib".`);
return data; }
}, return data;
), },
new NodePolyfillPlugin(), ),
new MiniCssExtractPlugin(), new NodePolyfillPlugin(),
new HtmlWebpackPlugin({ new MiniCssExtractPlugin(),
title: 'Filer Tests - Webpack Build', new HtmlWebpackPlugin({
template: './tests/webpack.index.html', title: 'Filer Tests - Webpack Build',
}), template: './tests/webpack.index.html',
}),
],
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
], ],
module: { },
rules: [ optimization: {
{ minimize: false,
test: /\.css$/i, },
use: [MiniCssExtractPlugin.loader, 'css-loader'], devtool: 'inline-source-map',
}, devServer: {
], contentBase: path.resolve(__dirname, './dist-webpack'),
}, }
optimization: {
minimize: false,
},
devtool: 'inline-source-map',
devServer: {
contentBase: path.resolve(__dirname, './dist-webpack'),
}
}); });