Git Product home page Git Product logo

Comments (8)

ricardogobbosouza avatar ricardogobbosouza commented on June 3, 2024 1

Hi @pvcresin
Try to use eslint-webpack-plugin

from eslint-loader.

ricardogobbosouza avatar ricardogobbosouza commented on June 3, 2024 1

@pvcresin set extensions:

new ESLintPlugin({
  extensions: ['ts', 'tsx'],
  failOnError: true,
})

from eslint-loader.

pvcresin avatar pvcresin commented on June 3, 2024 1

@ricardogobbosouza I totally get it. I was wrong. It works!!

  new ESLintPlugin({
    extensions: ['ts', 'tsx'],
    // failOnError: true,
  }),

It's hard to read English...
Thanks for the quick reply.

from eslint-loader.

pvcresin avatar pvcresin commented on June 3, 2024

@ricardogobbosouza I'll give it a shot.

from eslint-loader.

pvcresin avatar pvcresin commented on June 3, 2024

@ricardogobbosouza
I tried, but I got another error and it doesn't work. https://github.com/pvcresin/eslint-webpack-error
I'm getting an error in webpack.config.js.

yarn start
yarn run v1.22.4
$ webpack-dev-server --mode development
✖ 「wdm」:  [ESLintError: 
/Users/pvcresin/Desktop/eslint-plugin-error/webpack.config.js
  0:0  error  Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: webpack.config.js.
The file must be included in at least one of the projects provided

✖ 1 problem (1 error, 0 warnings)
] {
  name: 'ESLintError'
}
ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /

I found an issue with a similar error, but it wasn't very helpful. typescript-eslint/typescript-eslint#864

from eslint-loader.

pvcresin avatar pvcresin commented on June 3, 2024

@ricardogobbosouza Thank you. The correct error was obtained!

$ webpack-dev-server --mode development
✖ 「wdm」:  [ESLintError: 
/Users/pvcresin/.Trash/eslint-plugin-error/src/main.ts
  1:7  error  'a' is assigned a value but never used  no-unused-vars

✖ 1 problem (1 error, 0 warnings)
] {
  name: 'ESLintError'
}
ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /

https://github.com/pvcresin/eslint-webpack-error
[Problem] I fixed the code and the error doesn't go away.
And I can't get through to ts-loader.

const a = 100;
1:7  error  'a' is assigned a value but never used  no-unused-vars

✖ 1 problem (1 error, 0 warnings)
] {
  name: 'ESLintError'
}

And fix.

const a = 100;

console.log(a);

But stil...

1:7  error  'a' is assigned a value but never used  no-unused-vars

✖ 1 problem (1 error, 0 warnings)
] {
  name: 'ESLintError'
}

from eslint-loader.

ricardogobbosouza avatar ricardogobbosouza commented on June 3, 2024

See https://github.com/webpack-contrib/eslint-webpack-plugin#failonerror

from eslint-loader.

pvcresin avatar pvcresin commented on June 3, 2024

@ricardogobbosouza
Am I using failOnError incorrectly? https://github.com/pvcresin/eslint-webpack-error
Does failOnError mean that once it fails, I have to restart webpack-dev-server?
Does that mean I can't check for ESLint errors every time I save a file?

from eslint-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.