Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
mocha: Use correct function for merging lint configuration (#1219)
Browse files Browse the repository at this point in the history
The refactor in #1182 inadvertently used babel-merge's `merge()` to
merge ESLint configuration in this preset rather than deepmerge, since
the existing `merge` import was not the same as in other presets from
which the lint rule merging block was copied.

In a later PR I think we should stop exporting a merge function from
`@neutrinojs/compile-loader` named `merge`, to avoid the reduce the
chance of this kind of naming conflict.

Fixes:
taskcluster/taskcluster-web-server#59 (comment)
  • Loading branch information
edmorley authored Nov 23, 2018
1 parent 0488010 commit aac7682
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/mocha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@babel/plugin-transform-modules-commonjs": "^7.1.0",
"@babel/register": "^7.0.0",
"babel-merge": "^2.0.1",
"deepmerge": "^1.5.2",
"lodash.omit": "^4.5.0"
},
"peerDependencies": {
Expand Down
5 changes: 3 additions & 2 deletions packages/mocha/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const merge = require('babel-merge');
const babelMerge = require('babel-merge');
const merge = require('deepmerge');
const omit = require('lodash.omit');

module.exports = neutrino => {
Expand All @@ -23,7 +24,7 @@ module.exports = neutrino => {
? neutrino.config.module.rule('compile').use('babel').get('options')
: {};
const options = omit(
merge(
babelMerge(
baseOptions,
{
extensions: neutrino.options.extensions.map(ext => `.${ext}`),
Expand Down

0 comments on commit aac7682

Please sign in to comment.