Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to the new eslint.config.js format #190

Closed
Gabriel-Dias-Oliveira opened this issue Oct 26, 2022 · 6 comments
Closed

Add support to the new eslint.config.js format #190

Gabriel-Dias-Oliveira opened this issue Oct 26, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@Gabriel-Dias-Oliveira
Copy link
Contributor

Feature Proposal

Recently, Eslint received a new configuration file format Eslint flat config. It would be nice if the Eslint plugin recognized it as a valid configuration file.
I tried to use this, however, after setup everything up, I was able to use the rules on the format, but the webpack was not recognizing it as a valid file.
The following message was showing up:
ERROR in [eslint] No ESLint configuration found in...

Since I don't receive this error while using a .json file and all the rules are running okay, I'd say that the plugin don't support this type of file.

Feature Use Case

This feature will be very useful since the Eslint flat config seems to be promising and easier to maintain.

Please paste the results of npx webpack-cli info here, and mention other relevant information

System:
OS: Windows 10 10.0.19043
CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
Memory: 5.32 GB / 15.78 GB
Binaries:
Node: 16.18.0 - C:\Program Files\nodejs\node.EXE
npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (106.0.1370.52)
Internet Explorer: 11.0.19041.1566
Packages:
copy-webpack-plugin: ^11.0.0 => 11.0.0
esbuild-loader: ^2.20.0 => 2.20.0
eslint-webpack-plugin: ^3.2.0 => 3.2.0
file-loader: ^6.2.0 => 6.2.0
html-loader: ^4.2.0 => 4.2.0
html-loader-jest: ^0.2.1 => 0.2.1
html-webpack-plugin: ^5.5.0 => 5.5.0
raw-loader: ^4.0.2 => 4.0.2
webpack: ^5.74.0 => 5.74.0
webpack-cli: ^4.10.0 => 4.10.0
webpack-ext-reloader: ^1.1.9 => 1.1.9
webpackbar: ^5.0.2 => 5.0.2
zip-webpack-plugin: ^4.0.1 => 4.0.1

@ricardogobbosouza ricardogobbosouza added the enhancement New feature or request label Oct 27, 2022
@pgnd
Copy link

pgnd commented Apr 25, 2023

similarly, updated


Operating System: Linux 6.2 Fedora Linux 38 (Thirty Eight)
Node Version: v18.16.0
NPM Version: 9.5.1
webpack Version: 5.80.0
eslint Version: 8.39.0
eslint-webpack-plugin Version: 4.0.1

cd /path/to/app
ls -al eslint.* webpack.*
	-rw------- 1 wwwrun www 8.2K Apr 25 08:03 webpack.config.mjs
	-rw-rw---- 1 wwwrun www 3.1K Apr 24 12:28 eslint.config.js

yarn webpack --mode=development --progress --profile
	...
	ERROR in [eslint] No ESLint configuration found in /path/to/app/assets/js.

	webpack 5.80.0 compiled with 1 error in 422 ms

cat eslint.config.js

	import js from "@eslint/js";
	import { FlatCompat } from "@eslint/eslintrc";
	import path from "path";
	import { fileURLToPath } from "url";
	const __filename = fileURLToPath(import.meta.url);
	const __dirname = path.dirname(__filename);
	const compat = new FlatCompat({ baseDirectory: __dirname });
	export default [
		{
			ignores: [
			...
	...

-->

  • option to find/recognize/support existing eslint.config.js flat config
  • option to explicitly specify path-to-config

@alexander-akait
Copy link
Member

PR welcome

@lesha38
Copy link

lesha38 commented Mar 5, 2024

Good day! Can you tell me when to expect the release of this feature?

@zayne-wang
Copy link

zayne-wang commented Mar 14, 2024

@alexander-akait

Good day!

I thought this feature should be released ASAP. Current version (4.0.1) on npm still not have this feature, but the document has shown the feature has been included indeed. This is a huge misleading for people using this plugin.

@alexander-akait
Copy link
Member

Oh, let's do release 😄

@alexander-akait
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants