Skip to content

Commit f8290c5

Browse files
committed
bug #1076 fix: lazy-load ESLint plugin dependency, fix #1075 (Kocal)
This PR was squashed before being merged into the main branch. Discussion ---------- fix: lazy-load ESLint plugin dependency, fix #1075 This PR fixes #1075 by loading `eslint-plugin` only when it's needed. Failures are not related. cc `@weaverryan` Commits ------- faca367 fix: lazy-load ESLint plugin dependency, fix #1075
2 parents d4fb3f2 + faca367 commit f8290c5

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

lib/plugins/eslint.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
const forceSync = require('sync-rpc');
1313
const hasEslintConfiguration = forceSync(require.resolve('../utils/has-eslint-configuration'));
1414
const WebpackConfig = require('../WebpackConfig'); //eslint-disable-line no-unused-vars
15-
const EslintPlugin = require('eslint-webpack-plugin'); //eslint-disable-line node/no-unpublished-require
1615
const applyOptionsCallback = require('../utils/apply-options-callback');
1716
const pluginFeatures = require('../features');
1817

@@ -55,6 +54,8 @@ Install ${chalk.yellow('babel-eslint')} to prevent potential parsing issues: ${p
5554
extensions: ['js', 'jsx'],
5655
};
5756

57+
const EslintPlugin = require('eslint-webpack-plugin'); //eslint-disable-line node/no-unpublished-require
58+
5859
plugins.push({
5960
plugin: new EslintPlugin(
6061
applyOptionsCallback(webpackConfig.eslintPluginOptionsCallback, eslintPluginOptions)

yarn.lock

+2-16
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@
970970
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz#d5e0706cf8c6acd8c6032f8d54070af261bbbb2f"
971971
integrity sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==
972972

973-
"@eslint/eslintrc@^0.4.3":
973+
"@eslint/eslintrc@^0.4.1":
974974
version "0.4.3"
975975
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c"
976976
integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==
@@ -990,20 +990,6 @@
990990
resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.0.1.tgz#141f15645acaa3b133b7c247cad58ae252ffae85"
991991
integrity sha512-oHsJhgY2cip+K2ED7vKUNd2P+BEswVhrCYcJ802DSsblJFv7mPFVk3cQKvm2vHgHeDVdnj7oOKrBbzp1u8D+KA==
992992

993-
"@humanwhocodes/config-array@^0.5.0":
994-
version "0.5.0"
995-
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9"
996-
integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==
997-
dependencies:
998-
"@humanwhocodes/object-schema" "^1.2.0"
999-
debug "^4.1.1"
1000-
minimatch "^3.0.4"
1001-
1002-
"@humanwhocodes/object-schema@^1.2.0":
1003-
version "1.2.1"
1004-
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
1005-
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
1006-
1007993
"@nodelib/[email protected]":
1008994
version "2.1.5"
1009995
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
@@ -3712,7 +3698,7 @@ getpass@^0.1.1:
37123698
dependencies:
37133699
assert-plus "^1.0.0"
37143700

3715-
glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2:
3701+
glob-parent@^5.0.0, glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2:
37163702
version "5.1.2"
37173703
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
37183704
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==

0 commit comments

Comments
 (0)