-
Notifications
You must be signed in to change notification settings - Fork 507
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
.eslintrc doesn't override defaults #498
Comments
TSDX does support I also use You can change everything, but one difference with using an Some separate things to respond to that aren't directly related:
That is an opinion, plenty of opinionated libraries exist that don't allow you to change settings, like
That sounds like a bug with
You can certainly opt-out of these extras of TSDX -- you don't have to use |
I want to apologize for how that came out. It was an overly dramatic presentation of my own opinion. I do get that a lot of libraries don't let you change their settings, and usually for good reason (Almost everything I've ever worked on/designed has at least a little bit of that baked in). I meant that to be very specifically about linting/formatting, and it came out much more generalized. This is what happens when I get too little sleep 😞
What led me to filing this issue in the first place was that
That's the exact issue I was having const cli = new CLIEngine({
baseConfig: {
...config,
...appPackageJson.eslint,
+ .../* insert .eslintrc here */
}, I suppose it would be easy enough to keep the
The entire issue I had with the linting was because of the
That sounds like it would be ideal. |
No worries. Though the example I put of
Yea it kinda sounded like that's what you meant, but that's very confusing because
I looked into this before (like days ago but my head is very full this past week) and IIRC this was a common set-up. I'm pretty sure that ESLint does some more complex resolution than simply reading the file (e.g. extends etc) but idk for sure. Had some similar issues with
To avoid any confusion, it's: module.exports = {
rules: {
'prettier/prettier': 'off' // override tsdx lint
}
} |
Okay, now I'm confused. I had wiped out what I was doing previously, so I went to recreate it and share the results with you... but I'm having trouble doing that. I can't seem to replicate the issue any longer 🤷♂️. Maybe it was an environment issue. I'm not using the same machine now as I was then. Later next week I'll try to recreate the issue on the other machine. I'll go ahead and close this. If I'm able to recreate the issue, I'll post back here. |
Current Behavior
My
.eslintrc
settings are ignored.Expected behavior
If I define a
.eslintrc
in my repository, I expect its rules, and its rules alone, to be used. I do not ever, under any circumstances, want a dependency to set things that I cannot change, especially when it comes to linting/formatting my code.Suggested solution(s)
Currently, settings from the
package.json.eslint
property will override any configurations during linting, but not the rules from.eslintrc
. This is not ideal. I prefer to use.eslintrc
or.eslintrc.js
to define my eslint rules, since I find that it makes my life a little easier. Instead of having to go digging through mypackage.json
to find myeslint
rules any time I need to make changes, I can just go straight to where they are defined.package.json
can already wind up with quite a bit of information in it, andeslint
rules can also wind up being extensive. Easier to keep them segregated.Not to mention,
vscode-eslint
doesn't care aboutpackage.json.eslint
settings. So, if I want to make changes to myeslint
, I now have to do it in two places.If using
.eslintrc
is not a desired behavior, perhaps it might be better to let users opt out oftsdx
's linting altogether? Mainly, the issue I have is during the build. When I need to lint my code, I can do it witheslint
instead, which will use my rules as I have them configured.Additional context
Other than that, I have to say, great tool! 👍
Your environment
The text was updated successfully, but these errors were encountered: