Purpose of "Unexpected compiler option"
joeyparrish opened this issue · 2 comments
What is the purpose of "Unexpected compiler option"? I'm trying to add a test to a DefinitelyTyped module that relies on "noPropertyAccessFromIndexSignature", but I'm not allowed to add that option in tsconfig.json. Why not?
If this is really important, could you please add it to the docs in either this repo or DefinitelyTyped or both?
There's no reason to set noPropertyAccessFromIndexSignature
on DT, because the flag can only affect code in expression space. We in general don't allow people to set random flags that aren't useful when writing the types.
We did however allow exactOptionalPropertyTypes
(for testing), so, maybe this flag could be allowed too, but I have never heard this flag being a distinguishing factor. noPropertyAccessFromIndexSignature
is basically just a lint rule, so I would very much doubt that it would be critical to a DT test...
Not critical, just surprised me. I wanted to show that a dot-expression with an undefined property would error with that option turned on, in spite of the index-signature in mocha's Context. But that doesn't really matter to the types, so no worries.