Skip to content

Commit

Permalink
fix: optimize reduce addCypressToWebpackEslintRulesInPlace
Browse files Browse the repository at this point in the history
  • Loading branch information
Connormiha committed Sep 15, 2023
1 parent 0e239bf commit ca2e759
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion npm/webpack-dev-server/src/helpers/createReactAppHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ function addCypressToWebpackEslintRulesInPlace (webpackConfig: Configuration) {

if (eslintPlugin) {
const cypressGlobalsRules = cypressGlobals
.reduce((acc, global) => ({ ...acc, [global]: 'writable' }), {})
.reduce((acc, global) => {
acc[global] = 'writable';

return acc;
}, {})

eslintPlugin.options.baseConfig = {
...eslintPlugin.options.baseConfig,
Expand Down

0 comments on commit ca2e759

Please sign in to comment.