From 521271851de3bc7674e6a9a3299c71505e6d2231 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Tue, 17 Apr 2018 23:36:17 -0700 Subject: [PATCH] fix ESLint problems and consolidate configuration - we weren't being strict enough about disallowing ES6. even though we had `es6: false` in the config, the `parserOptions` were set to use `ecmaVersion: 8`. oops - linted a couple files - deleted all `.eslintrc.yml` files except for the root one; use `overrides` instead Signed-off-by: Christopher Hiller --- .eslintrc.yml | 29 ++++++++++++++++++++++++++++- bin/.eslintrc.yml | 3 --- docs/.eslintrc.yml | 3 --- lib/browser/.eslintrc.yml | 4 ---- scripts/.eslintrc.yml | 3 --- test/.eslintrc.yml | 7 ------- test/reporters/helpers.js | 8 ++++---- test/unit/grep.spec.js | 2 +- 8 files changed, 33 insertions(+), 26 deletions(-) delete mode 100644 bin/.eslintrc.yml delete mode 100644 docs/.eslintrc.yml delete mode 100644 lib/browser/.eslintrc.yml delete mode 100644 scripts/.eslintrc.yml delete mode 100644 test/.eslintrc.yml diff --git a/.eslintrc.yml b/.eslintrc.yml index 86337ec874..ed9026ab9d 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -3,8 +3,12 @@ extends: semistandard env: node: yes browser: yes - es6: no parserOptions: + ecmaVersion: 5 + ecmaFeatures: + globalReturn: no + experimentalObjectRestSpread: no + jsx: no sourceType: script rules: strict: @@ -13,3 +17,26 @@ rules: linebreak-style: - error - unix +overrides: + - files: + - scripts/**/*.js + - package-scripts.js + - karma.conf.js + - .wallaby.js + - bin/* + parserOptions: + ecmaVersion: 6 + env: + browser: no + - files: + - test/**/*.js + env: + mocha: yes + globals: + expect: no + assert: no + - files: + - doc/**/*.js + env: + node: no + diff --git a/bin/.eslintrc.yml b/bin/.eslintrc.yml deleted file mode 100644 index 36e0a779be..0000000000 --- a/bin/.eslintrc.yml +++ /dev/null @@ -1,3 +0,0 @@ -env: - es6: true - browser: false diff --git a/docs/.eslintrc.yml b/docs/.eslintrc.yml deleted file mode 100644 index 6887df39ef..0000000000 --- a/docs/.eslintrc.yml +++ /dev/null @@ -1,3 +0,0 @@ -env: - browser: true - node: false diff --git a/lib/browser/.eslintrc.yml b/lib/browser/.eslintrc.yml deleted file mode 100644 index d85f537d3b..0000000000 --- a/lib/browser/.eslintrc.yml +++ /dev/null @@ -1,4 +0,0 @@ -env: - node: false - browser: false - commonjs: true diff --git a/scripts/.eslintrc.yml b/scripts/.eslintrc.yml deleted file mode 100644 index 36e0a779be..0000000000 --- a/scripts/.eslintrc.yml +++ /dev/null @@ -1,3 +0,0 @@ -env: - es6: true - browser: false diff --git a/test/.eslintrc.yml b/test/.eslintrc.yml deleted file mode 100644 index 92622be761..0000000000 --- a/test/.eslintrc.yml +++ /dev/null @@ -1,7 +0,0 @@ -env: - mocha: true -globals: - expect: false - assert: false -rules: - no-unused-expressions: off diff --git a/test/reporters/helpers.js b/test/reporters/helpers.js index 08c96ae165..aa1af15742 100644 --- a/test/reporters/helpers.js +++ b/test/reporters/helpers.js @@ -149,8 +149,8 @@ function makeExpectedTest ( } module.exports = { - createMockRunner, - makeTest, - createElements, - makeExpectedTest + createMockRunner: createMockRunner, + makeTest: makeTest, + createElements: createElements, + makeExpectedTest: makeExpectedTest }; diff --git a/test/unit/grep.spec.js b/test/unit/grep.spec.js index 0e9b60ef7b..b25fbc901c 100644 --- a/test/unit/grep.spec.js +++ b/test/unit/grep.spec.js @@ -61,7 +61,7 @@ describe('Mocha', function () { describe('"invert" option', function () { it('should add a Boolean to the mocha.options object', function () { var mocha = new Mocha({ invert: true }); - expect(mocha.options.invert).to.be.ok; + expect(mocha.options.invert, 'to be', true); }); }); });