-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[tsc] Inform user when detected tsconfig.json file is not being applied #6603
Comments
#6600 might be the way to fixing this. |
But in my case, there is no error with my tsconfig.json file. It's just not being read or used because I'm compiling an individual file, so I'm not sure how #6600 has anything to do with this. |
this will be a breaking change, since existing projects today can have tsconfig but not use that in build. |
but maybe at least give a warning from the compiler log which tsconfig is being applied, is there a flag? |
Would have saved me a few hours if this message had been implemented. As it stands I tried every possible combination of changes to tsconfig.json to make it work, only to eventually find out that tsconfig.json was being ignored because I am specifying the file to be compiled on the command line, which is really unexpected behaviour - "ah, you're specifying your input file? I see, well just to punish you for that, no tsconfig.json for you ha ha!" |
@mhegazy this won't be a breaking change if we limit the fix to just informing the user which tsconfig file is being applied, as @aredfox suggested. Can we go that route at the very least? I'm not sure how a message would be a breaking change. It doesn't have to be an error or even a warning. Just inform us what's being applied, right? |
Some people consider console output to be a breaking change #24123 (we don't) It's a legitimate problem from the API perspective though; a build chain might reasonably be invoking |
I wonder if a To add an example on how this can confuse users now: I was specifying the input file via cli arg, and my build was failing. The error asked me to specify a compiler option ( |
As a TypeScript beginner this behavior really threw me off. It seems to be mentioned in only a single paragraph in
This paragraph is not distinctive in any way so it's really easy to miss. It would be very helpful if that was emphasized somehow and if this info was added to I'm sure there are many non-breaking things that can be done to make people aware of this usually unexpected behavior. Btw, is there a way to run |
So I just found out that I have been using tsc with a tsconfig that was being ignored for days already. This is really unexpected behavior afaic and it would help a lot if it would print just a bit of log output saying something like:
|
If you interpret any output at all as an error, you will get false positives on errors, right? Who is to blame there? |
This seems to surprise about one person every six months, the risk of breaking build chains is definitely nonzero, we'd need to provide some new way to opt out of the warning, and it's clearly described in the documentation. so this isn't meeting the bar. |
I think that's a pretty bold claim. Let me translate: we get one issue report every 6 months. I think you will find that for every person actually taking the trouble to report an issue there are hundreds that were equally surprised but just didn't report it. Also I think if an issue gets reported over and over (even if 'just' once every 6 months) that's a pretty strong indication that something is amiss. But yeah if printing a warning is too risky I guess there are not much options left... |
Where? Are you talking about
It's a single sentence that we cannot even link to because it has no header. I think calling it clear is a bit optimistic. |
Yep, I found it only because I was specifically looking for it. |
Under the following conditions...
tsc
command is run directly on files, instead of a project.tsconfig.json
file is detected.I'm requesting that the user be informed the detected
tsconfig.json
file is not being read, because the project is not being compiled. I'm not sure the best language for this message, but I'm envisioning something to this effect...This would prevent issues like #6591, which I was having before.
The text was updated successfully, but these errors were encountered: