You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--isolatedModules should warn about re-export of type #15231
Hm... what exactly is --isolatedModules supposed to do?
I have been using it as a way of requiring that only files parsed as "module" would be considered valid (i.e. requires at least one "import" or "export" in typescript, forbids (potentially sloppy) scripts), though preventing reexporting of types would break things on my project.
I can turn of --isolatedModules off in 2.4 in that case, but since it seems to do more than what I thought it did, I wonder what would be the side effects.
It guarantees that the file can be transpiled in isolation. Hence the isolated part. Things that need cross file information to emit like namespaces spanning multiple files or const enums are not alloewd. This is what you would use if you were using transpileModule API.
If that is the case, disabling --isolatedModules could be problematic in my codebase, as I have multiple independent (non-exported) interface Props {} in different files. IIUC, this would cause them to augment each other instead of still being independent.
Andy (Andrewkraft) (@Andy-MS) ah, that happens sometimes in github. The thing in question was about type / interface in .d.ts being exported regardless of the presence of export, which upon thinking further wouldn't (unintentionally) be further augmentable.
Activity
Jessidhia commentedon May 10, 2017
Hm... what exactly is
--isolatedModulessupposed to do?I have been using it as a way of requiring that only files parsed as "module" would be considered valid (i.e. requires at least one "import" or "export" in typescript, forbids (potentially sloppy) scripts), though preventing reexporting of types would break things on my project.
I can turn of
--isolatedModulesoff in 2.4 in that case, but since it seems to do more than what I thought it did, I wonder what would be the side effects.mhegazy commentedon May 10, 2017
It guarantees that the file can be transpiled in isolation. Hence the isolated part. Things that need cross file information to emit like namespaces spanning multiple files or const enums are not alloewd. This is what you would use if you were using transpileModule API.
Jessidhia commentedon May 10, 2017
So I assume the absence of
--isolatedModulesis what causes this behavior? DefinitelyTyped/DefinitelyTyped#16118 (comment)If that is the case, disabling
--isolatedModulescould be problematic in my codebase, as I have multiple independent (non-exported)interface Props {}in different files. IIUC, this would cause them to augment each other instead of still being independent.Jessidhia commentedon May 11, 2017
Andy (Andrewkraft) (@Andy-MS) ah, that happens sometimes in github. The thing in question was about
type/interfacein.d.tsbeingexported regardless of the presence ofexport, which upon thinking further wouldn't (unintentionally) be further augmentable.