Giter Site home page Giter Site logo

Comments (14)

mtscout6 avatar mtscout6 commented on May 31, 2024

Using this might help: https://github.com/eslint/eslint/blob/v0.17.0/lib/config.js#L332

from eslint-loader.

MoOx avatar MoOx commented on May 31, 2024

The problem is that webpack loaders do not give the filename but only send the input to process.
So I can't handle this case because I am using eslint CLIEngine#executeOnText().

In order to fix that we need first the filename in the loader (poke @sokra) so we can pass to eslint in order to get proper eslintrc file.

from eslint-loader.

sokra avatar sokra commented on May 31, 2024

You have access to the filename in the loader function via this.resourcePath. The jshint-loader also uses .jshintrc

from eslint-loader.

MoOx avatar MoOx commented on May 31, 2024

Oh good to know. Thanks @sokra.
I will update the loader accordingly.

from eslint-loader.

mtscout6 avatar mtscout6 commented on May 31, 2024

When you do this can you also respect the .eslintignore file? Or would you prefer a separate issue for that?

from eslint-loader.

MoOx avatar MoOx commented on May 31, 2024

Yes please, a separate issue. Or a separate PR ;)

from eslint-loader.

MoOx avatar MoOx commented on May 31, 2024

@mtscout6 I investigated on this issue.

For now this cannot be done properly since method that use text for processing doesn't accept filepath or something that will allow us to adjust the config (executeOnText()/processText() just call getConfig() without arguments, and I cannot change that).
I cannot use something at a lower level (eg: verify()) cause in this case, I can't access private loadPlugins() method (which is called by other higher level method) and so plugins will not be loaded.
I can use processOnFile() but that will use a fs read which is stupid because it has already been done.
We need to open an issue on eslint to

  • add a parameter to text methods to receive a filename to pass to getConfig()
    OR
  • make public loadPlugins() methods and other methods that might be required to use in order to get a full linting.

I hope I am clear on this.

poke @nzakas

from eslint-loader.

tomchentw avatar tomchentw commented on May 31, 2024

Experienced the same issue today, thanks for investigating.
@MoOx ++

from eslint-loader.

nzakas avatar nzakas commented on May 31, 2024

@MoOx please file an issue if you have a request

from eslint-loader.

punmechanic avatar punmechanic commented on May 31, 2024

+1 seems that eslint-loader is still not respecting .eslintrc

from eslint-loader.

MoOx avatar MoOx commented on May 31, 2024

It depends on your setup. I sucessfuly use .eslintrc on a lot of project using this loader.
Like Nicholas said, someone can open an issue on eslint repo, I think I gave enough information to help.

from eslint-loader.

MoOx avatar MoOx commented on May 31, 2024

Closed by 1bf9bf9

from eslint-loader.

tomchentw avatar tomchentw commented on May 31, 2024

This is awesome! Thanks @MoOx !!

from eslint-loader.

MoOx avatar MoOx commented on May 31, 2024

Do not thank me. Thanks @mgtitimoli
But... #44

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.