webpack-contrib / eslint-webpack-plugin

A ESLint plugin for webpack
MIT License
254 stars 47 forks source link

ERROR in No ESLint configuration found in ... #86

Closed Andrey-Bushman closed 3 years ago

Andrey-Bushman commented 3 years ago

Expected Behavior

I try to use eslint-webpack-plugin according to your example. I thought that eslint-webpack-plugin will use optional options that I pass into the ESLintPlugin constructor and therefore .eslintrc file is not neccessary now. I tried to use constructor without options or with an empty object but I get an error.

Actual Behavior

I get the error:

ERROR in No ESLint configuration found in C:\Sources\excel-course\src.

Am I to create the .eslintrc file? Must I to use @babel/eslint-parser with eslint-webpack-plugin? I want to lint my original JS-files instead of linting of JS-files that are the transpilling result by Babel.

Code

I published my webpack.config.js and package.json files on Gist here.

Also I published completely my 'hello world' project with this problem on GitHub here (look at webpack branch).

How Do We Reproduce?

git clone https://github.com/Andrey-Bushman/excel-course.git
cd ./excel-course/
git checkout webpack
npm i
npm start
ricardogobbosouza commented 3 years ago

Hi @Andrey-Bushman Yes, you need to create a config file .eslintrc.js, https://eslint.org/docs/user-guide/getting-started#configuration Yes, you need @babel/eslint-parser

This plugin uses eslint under the hood, if an error occurs while running./node_modules/.bin/eslint src it means that there is an error in its configuration.

Andrey-Bushman commented 3 years ago

@ricardogobbosouza Thank you!