From 3c104115940d78b09c949f3e8528a5c9b5e4ac42 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Fri, 3 Apr 2020 07:56:59 +0800 Subject: [PATCH] - Linting (ESLint): Make path dynamic in preparation for possible move to own library and to avoid complaints when mochawesome.json not yet built --- .eslintrc.js | 7 ------- tools/mochawesome-cli.js | 5 ++++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 90f4188f..e71d2bfd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -228,13 +228,6 @@ module.exports = { strict: 'off' } }, - { - extends: ['plugin:node/recommended-script'], - files: [ - 'cypress/support/build-coverage-badge.js', - 'build/testing-badge.js' - ] - }, { // Should probably have as external, but should still check files: ['canvg/rgbcolor.js'], diff --git a/tools/mochawesome-cli.js b/tools/mochawesome-cli.js index db5bf29c..d0309b67 100644 --- a/tools/mochawesome-cli.js +++ b/tools/mochawesome-cli.js @@ -20,6 +20,8 @@ const reporterFile = process.argv[2] ? process.argv[2].replace(/^--/u, '') : 'spec'; +const path = '../mochawesome.json'; + // eslint-disable-next-line import/no-dynamic-require const MochaReporter = require(`mocha/lib/reporters/${reporterFile}.js`); const Suite = require('mocha/lib/suite.js'); @@ -36,7 +38,8 @@ const {constants: { EVENT_TEST_PENDING }} = require('mocha/lib/runner.js'); -const {results, stats} = require('../mochawesome.json'); +// eslint-disable-next-line import/no-dynamic-require +const {results, stats} = require(path); const runner = new Runner( new Suite('', null, true)