diff --git a/.eslintignore b/.eslintignore index 917376c..8225baa 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,2 @@ -lib/* /node_modules /dist diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index a7f05e0..0000000 --- a/.eslintrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "webpack", - "globals": { - "document": true, - "window": true - }, - "parserOptions": { - "sourceType": "script" - }, - "rules": { - "comma-dangle": ["error", "never"], - "consistent-return": "off", - "no-param-reassign": "off", - "no-underscore-dangle": "off", - "prefer-destructuring": ["error", {"object": false, "array": false}], - "prefer-rest-params": "off", - "strict": ["error", "safe"] - } -} diff --git a/.eslintrc.js b/.eslintrc.js index 5287d21..929a75c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,9 +3,16 @@ module.exports = { plugins: ['prettier'], extends: ['@webpack-contrib/eslint-config-webpack'], rules: { + "consistent-return": "off", + "no-console": "off", + "no-param-reassign": "off", + "no-underscore-dangle": "off", + "prefer-destructuring": ["error", {"object": false, "array": false}], + "prefer-rest-params": "off", + "strict": ["error", "safe"], 'prettier/prettier': [ 'error', { singleQuote: true, trailingComma: 'es5', arrowParens: 'always' }, ], }, -}; \ No newline at end of file +}; diff --git a/lib/KarmaWebpackController.js b/lib/KarmaWebpackController.js index e2600c2..659e041 100644 --- a/lib/KarmaWebpackController.js +++ b/lib/KarmaWebpackController.js @@ -1,5 +1,3 @@ -/* eslint-disable no-console */ - const path = require('path'); const fs = require('fs'); const os = require('os'); @@ -21,12 +19,10 @@ class KarmaSyncPlugin { // read generated file content and store for karma preprocessor this.controller.bundlesContent = {}; stats.toJson().assets.forEach((webpackFileObj) => { - const filePath = `${compiler.options.output.path}/${ - webpackFileObj.name - }`; + const filePath = `${compiler.options.output.path}/${webpackFileObj.name}`; this.controller.bundlesContent[webpackFileObj.name] = fs.readFileSync( filePath, - 'utf-8', + 'utf-8' ); }); @@ -88,7 +84,7 @@ class KarmaWebpackController { new KarmaSyncPlugin({ karmaEmitter: emitter, controller: this, - }), + }) ); } @@ -135,13 +131,13 @@ class KarmaWebpackController { if (this.webpackOptions.watch === true) { console.log('Webpack starts watching...'); this.compiler = webpack(this.webpackOptions, (err, stats) => - this.handleBuildResult(err, stats, resolve), + this.handleBuildResult(err, stats, resolve) ); this.setupExitHandler(this.compiler); } else { this.compiler = webpack(this.webpackOptions).run((err, stats) => - this.handleBuildResult(err, stats, resolve), + this.handleBuildResult(err, stats, resolve) ); } }); diff --git a/package.json b/package.json index e18bd96..2c35b1c 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@commitlint/cli": "^7.1.1", "@commitlint/config-conventional": "^7.1.1", "@webpack-contrib/defaults": "^2.5.0", - "@webpack-contrib/eslint-config-webpack": "^2.0.4", + "@webpack-contrib/eslint-config-webpack": "^3.0.0", "babel-cli": "^6.26.0", "babel-jest": "^23.4.2", "babel-plugin-transform-object-rest-spread": "^6.26.0", diff --git a/test/integration/scenarios/basic-setup/basic-setup.test.js b/test/integration/scenarios/basic-setup/basic-setup.test.js index 7c83f26..910398f 100644 --- a/test/integration/scenarios/basic-setup/basic-setup.test.js +++ b/test/integration/scenarios/basic-setup/basic-setup.test.js @@ -29,7 +29,7 @@ describe('A basic karma-webpack setup', () => { plugins: [karmaWebpack, karmaChromeLauncher, karmaMocha, karmaChai], port: 2389, logLevel: 'ERROR', - singleRun: true, + singleRun: true }; beforeAll((done) => { diff --git a/test/integration/utils/ScenarioUtils.js b/test/integration/utils/ScenarioUtils.js index 9edd646..930c1e5 100644 --- a/test/integration/utils/ScenarioUtils.js +++ b/test/integration/utils/ScenarioUtils.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ const karma = require('karma'); const ScenarioUtils = { run };