Skip to content

Commit ef70c34

Browse files
committed
Drop ESLint integration
1 parent a39f4a0 commit ef70c34

13 files changed

+11
-519
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This is a new major version that contains several backwards-compatibility breaks
1010

1111
* #1308 Drop Vue 2 support (End-Of-Life), only Vue 3 is supported (@Kocal)
1212

13+
* #1309 Drop ESLint integration (@Kocal)
14+
1315
## 4.7.0
1416

1517
### Features

index.js

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,38 +1263,6 @@ class Encore {
12631263
return this;
12641264
}
12651265

1266-
/**
1267-
* If enabled, the eslint-webpack-plugin is enabled.
1268-
*
1269-
* https://github.com/webpack-contrib/eslint-webpack-plugin
1270-
*
1271-
* ```
1272-
* // enables the eslint plugin using the default eslint configuration.
1273-
* Encore.enableEslintPlugin();
1274-
*
1275-
* // You can also pass in an object of options
1276-
* // that will be passed on to the eslint-webpack-plugin
1277-
* Encore.enableEslintPlugin({
1278-
* emitWarning: false
1279-
* });
1280-
*
1281-
* // For a more advanced usage you can pass in a callback
1282-
* // https://github.com/webpack-contrib/eslint-webpack-plugin#options
1283-
* Encore.enableEslintPlugin((options) => {
1284-
* options.extensions.push('vue'); // to lint Vue files
1285-
* options.emitWarning = false;
1286-
* });
1287-
* ```
1288-
*
1289-
* @param {string|object|function} eslintPluginOptionsOrCallback
1290-
* @returns {Encore}
1291-
*/
1292-
enableEslintPlugin(eslintPluginOptionsOrCallback = () => {}) {
1293-
webpackConfig.enableEslintPlugin(eslintPluginOptionsOrCallback);
1294-
1295-
return this;
1296-
}
1297-
12981266
/**
12991267
* If enabled, display build notifications using
13001268
* webpack-notifier.

lib/WebpackConfig.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ class WebpackConfig {
8989
this.useReact = false;
9090
this.usePreact = false;
9191
this.useVueLoader = false;
92-
this.useEslintPlugin = false;
9392
this.useTypeScriptLoader = false;
9493
this.useForkedTypeScriptTypeChecking = false;
9594
this.useBabelTypeScriptPreset = false;
@@ -134,7 +133,6 @@ class WebpackConfig {
134133
this.watchOptionsConfigurationCallback = () => {};
135134
this.devServerOptionsConfigurationCallback = () => {};
136135
this.vueLoaderOptionsCallback = () => {};
137-
this.eslintPluginOptionsCallback = () => {};
138136
this.tsConfigurationCallback = () => {};
139137
this.handlebarsConfigurationCallback = () => {};
140138
this.miniCssExtractLoaderConfigurationCallback = () => {};
@@ -148,7 +146,6 @@ class WebpackConfig {
148146
less: () => {},
149147
stylus: () => {},
150148
vue: () => {},
151-
eslint: () => {},
152149
typescript: () => {},
153150
handlebars: () => {},
154151
svelte: () => {},
@@ -765,22 +762,6 @@ class WebpackConfig {
765762
}
766763
}
767764

768-
enableEslintPlugin(eslintPluginOptionsOrCallback = () => {}) {
769-
logger.deprecation('The ESLint integration is now deprecated and will be removed in the next major release. Please use the standalone ESLint CLI instead, or use the ESLint Webpack plugin directly.');
770-
771-
this.useEslintPlugin = true;
772-
773-
if (typeof eslintPluginOptionsOrCallback === 'function') {
774-
this.eslintPluginOptionsCallback = eslintPluginOptionsOrCallback;
775-
} else if (typeof eslintPluginOptionsOrCallback === 'object') {
776-
this.eslintPluginOptionsCallback = (options) => {
777-
Object.assign(options, eslintPluginOptionsOrCallback);
778-
};
779-
} else {
780-
throw new Error('Argument 1 to enableEslintPlugin() must be either an object or callback function.');
781-
}
782-
}
783-
784765
enableBuildNotifications(enabled = true, notifierPluginOptionsCallback = () => {}) {
785766
if (typeof notifierPluginOptionsCallback !== 'function') {
786767
throw new Error('Argument 2 to enableBuildNotifications() must be a callback function.');

lib/config-generator.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const vuePluginUtil = require('./plugins/vue');
3636
const friendlyErrorPluginUtil = require('./plugins/friendly-errors');
3737
const assetOutputDisplay = require('./plugins/asset-output-display');
3838
const notifierPluginUtil = require('./plugins/notifier');
39-
const eslintPluginUtil = require('./plugins/eslint');
4039
const PluginPriorities = require('./plugins/plugin-priorities');
4140
const applyOptionsCallback = require('./utils/apply-options-callback');
4241
const copyEntryTmpName = require('./utils/copyEntryTmpName');
@@ -466,8 +465,6 @@ class ConfigGenerator {
466465

467466
vuePluginUtil(plugins, this.webpackConfig);
468467

469-
eslintPluginUtil(plugins, this.webpackConfig);
470-
471468
if (!this.webpackConfig.runtimeConfig.outputJson) {
472469
const friendlyErrorPlugin = friendlyErrorPluginUtil(this.webpackConfig);
473470
plugins.push({

lib/features.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,6 @@ const features = {
111111
],
112112
description: 'use Vue with JSX support'
113113
},
114-
eslint_plugin: {
115-
method: 'enableEslintPlugin()',
116-
// eslint is needed so the end-user can do things
117-
packages: [
118-
{ name: 'eslint' },
119-
{ name: 'eslint-webpack-plugin', enforce_version: true },
120-
],
121-
description: 'Enable ESLint checks'
122-
},
123114
copy_files: {
124115
method: 'copyFiles()',
125116
packages: [

lib/plugins/eslint.js

Lines changed: 0 additions & 113 deletions
This file was deleted.

lib/utils/has-eslint-configuration.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"resolve-url-loader": "^5.0.0",
4141
"semver": "^7.3.2",
4242
"style-loader": "^3.3.0",
43-
"sync-rpc": "^1.3.6",
4443
"tapable": "^2.2.1",
4544
"terser-webpack-plugin": "^5.3.0",
4645
"tmp": "^0.2.1",
@@ -70,7 +69,6 @@
7069
"eslint-plugin-header": "^3.0.0",
7170
"eslint-plugin-import": "^2.26.0",
7271
"eslint-plugin-node": "^11.1.0",
73-
"eslint-webpack-plugin": "^3.1.0 || ^4.0.0",
7472
"file-loader": "^6.0.0",
7573
"fork-ts-checker-webpack-plugin": "^7.0.0 || ^8.0.0 || ^9.0.0",
7674
"fs-extra": "^10.0.0",
@@ -112,8 +110,6 @@
112110
"@vue/babel-plugin-jsx": "^1.0.0",
113111
"@vue/babel-preset-jsx": "^1.0.0",
114112
"@vue/compiler-sfc": "^2.6 || ^3.0.2",
115-
"eslint": "^8.0.0",
116-
"eslint-webpack-plugin": "^3.1.0 || ^4.0.0",
117113
"file-loader": "^6.0.0",
118114
"fork-ts-checker-webpack-plugin": "^7.0.0 || ^8.0.0 || ^9.0.0",
119115
"handlebars": "^4.7.7",
@@ -165,12 +161,6 @@
165161
"@vue/compiler-sfc": {
166162
"optional": true
167163
},
168-
"eslint": {
169-
"optional": true
170-
},
171-
"eslint-webpack-plugin": {
172-
"optional": true
173-
},
174164
"file-loader": {
175165
"optional": true
176166
},

test/WebpackConfig.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,29 +1483,29 @@ describe('WebpackConfig object', () => {
14831483
const config = createConfig();
14841484
const callback = (loader) => {};
14851485

1486-
expect(config.loaderConfigurationCallbacks['eslint']).to.not.equal(callback);
1486+
expect(config.loaderConfigurationCallbacks['javascript']).to.not.equal(callback);
14871487

1488-
config.configureLoaderRule('eslint', callback);
1489-
expect(config.loaderConfigurationCallbacks['eslint']).to.equal(callback);
1488+
config.configureLoaderRule('javascript', callback);
1489+
expect(config.loaderConfigurationCallbacks['javascript']).to.equal(callback);
14901490
});
14911491

14921492
it('Call method with a not supported loader', () => {
14931493
const config = createConfig();
14941494

14951495
expect(() => {
14961496
config.configureLoaderRule('reason');
1497-
}).to.throw('Loader "reason" is not configurable. Valid loaders are "javascript", "css", "images", "fonts", "sass", "less", "stylus", "vue", "eslint", "typescript", "handlebars", "svelte" and the aliases "js", "ts", "scss".');
1497+
}).to.throw('Loader "reason" is not configurable. Valid loaders are "javascript", "css", "images", "fonts", "sass", "less", "stylus", "vue", "typescript", "handlebars", "svelte" and the aliases "js", "ts", "scss".');
14981498
});
14991499

15001500
it('Call method with not a valid callback', () => {
15011501
const config = createConfig();
15021502

15031503
expect(() => {
1504-
config.configureLoaderRule('eslint');
1504+
config.configureLoaderRule('javascript');
15051505
}).to.throw('Argument 2 to configureLoaderRule() must be a callback function.');
15061506

15071507
expect(() => {
1508-
config.configureLoaderRule('eslint', {});
1508+
config.configureLoaderRule('javascript', {});
15091509
}).to.throw('Argument 2 to configureLoaderRule() must be a callback function.');
15101510
});
15111511
});

0 commit comments

Comments
 (0)