Skip to content

Commit

Permalink
bug #1175 Delay force sync until needed (wesoledi, weaverryan)
Browse files Browse the repository at this point in the history
This PR was merged into the main branch.

Discussion
----------

Delay force sync until needed

Hi!

This finishes #1155.

Cheers!

Commits
-------

ca95954 moving most require back to the top
530eed5 2022-08-15 - move const def under main condition - do not init if not nessesary
  • Loading branch information
weaverryan committed Apr 19, 2023
2 parents bf51541 + ca95954 commit b6e6b17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/plugins/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
'use strict';

const forceSync = require('sync-rpc');
const hasEslintConfiguration = forceSync(require.resolve('../utils/has-eslint-configuration'));
const WebpackConfig = require('../WebpackConfig'); //eslint-disable-line no-unused-vars
const applyOptionsCallback = require('../utils/apply-options-callback');
const pluginFeatures = require('../features');
Expand All @@ -25,6 +24,8 @@ const babelLoaderUtil = require('../loaders/babel');
*/
module.exports = function(plugins, webpackConfig) {
if (webpackConfig.useEslintPlugin) {
const hasEslintConfiguration = forceSync(require.resolve('../utils/has-eslint-configuration'));

pluginFeatures.ensurePackagesExistAndAreCorrectVersion('eslint_plugin');

if (!hasEslintConfiguration(webpackConfig)) {
Expand Down

0 comments on commit b6e6b17

Please sign in to comment.