Comments (14)
Using this might help: https://github.com/eslint/eslint/blob/v0.17.0/lib/config.js#L332
from eslint-loader.
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.
You have access to the filename in the loader function via this.resourcePath
. The jshint-loader also uses .jshintrc
from eslint-loader.
Oh good to know. Thanks @sokra.
I will update the loader accordingly.
from eslint-loader.
When you do this can you also respect the .eslintignore
file? Or would you prefer a separate issue for that?
from eslint-loader.
Yes please, a separate issue. Or a separate PR ;)
from eslint-loader.
@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.
Experienced the same issue today, thanks for investigating.
@MoOx ++
from eslint-loader.
@MoOx please file an issue if you have a request
from eslint-loader.
+1 seems that eslint-loader
is still not respecting .eslintrc
from eslint-loader.
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.
Closed by 1bf9bf9
from eslint-loader.
This is awesome! Thanks @MoOx !!
from eslint-loader.
Do not thank me. Thanks @mgtitimoli
But... #44
from eslint-loader.
Related Issues (20)
- Loader reporting syntax errors when dealing with typescript files HOT 10
- TypeError: CLIEngine is not a constructor HOT 1
- Different lint results between webpack and cli HOT 1
- How to now fail the build on error or warning HOT 2
- Combining eslint-loader + vue + typescript causes the build to fail on the first run, but work on the second run HOT 2
- please update minimist due to prototype pollution (CVE-2020-7598) HOT 8
- Cannot read property 'range' of null HOT 3
- vscode integration
- exclude option not working. HOT 12
- Eslint-loader is not using .eslintrc.js configuration HOT 1
- failOnError option doesn't work with ts-loader and webpack-dev-server HOT 8
- CLIEngine has been deprecated HOT 1
- eslint-plugin-import fails to load properties with eslint-loader but works with stand alone eslint HOT 1
- Parsing error: Unexpected token .. HOT 1
- Cannot read property 'getFormatter' of undefined HOT 2
- Missing plugin referenced by .eslintrc file in ignored node_modules folder causes warning HOT 4
- Plugin "import" was conflicted HOT 2
- eslint-laoder failing the build even if the failOnError set to false HOT 2
- relative path is wrong when use eslint-loader in monorepo HOT 1
- Deprecate eslint-loader HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-loader.