disable certain global types for specific files, or specify type roots for specific files.
This continues some ideas from https://github.com/microsoft/TypeScript/issues/17042, which was closed by @microsoft (for inactivity, I think?). ## Search Terms disable certain global types for specific files, specific type roots for certain files ## Suggestion Ability to specify which `@types` (or in general, which specified `typeRoots`) apply to which files in a project. ## Use Cases My project's `src` folder contains both `.ts` and `.test.ts` files, and I'd like an easy way for globals like `describe` to be defined only for the `.test.ts` files. ## Examples Not sure, but maybe some sort of new options in `tsconfig.json` for specifying which `types` items, `lib` items, or `typeRoots` items apply to which files. This would be a beneficial feature because various editors (VS Code aside) look for a `tsconfig.json` file at the root of a project, and at the moment the only way to make types work in all files is to just provides all types for all files, which is undesirable because `describe` is not a function that is available in source files (as an example). Example configuration: maybe instead of a `typeRoots` array, it can be an object like: ```js "typeRoots": { "./src/**/*.test.ts": ["../path/to/test/types"], // test-only types "./src/**/*.ts": ["../path/to/@types"] // other types other files } ``` Or something. That's just an example to get the idea rolling. ## Checklist My suggestion meets these guidelines: * [x] This wouldn't be a breaking change in exis
Posted by trusktr on Feb 26, 2020, 7:47 PM
Tags
Related issues
- [Meta] Feedback on granular control over Copilot changes
- unexpected status 401 Unauthorized issue
- [MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
- [CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
- Video stops playing after some minutes
- [MODEL] Claude verbose code comments by default — ignores instructions to stop.
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
github (Software)
[Meta] Feedback on granular control over Copilot changes
unexpected status 401 Unauthorized issue
[MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
[CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
Video stops playing after some minutes
[MODEL] Claude verbose code comments by default — ignores instructions to stop.
Scope Codex VS Code chats to the current workspace/project
Update on "Co-authored-by: Copilot" in commit messages
disable certain global types for specific files, or specify type roots for specific files.
This continues some ideas from https://github.com/microsoft/TypeScript/issues/17042, which was closed by @microsoft (for inactivity, I think?). ## Search Terms disable certain global types for specific files, specific type roots for certain files ## Suggestion Ability to specify which `@types` (or in general, which specified `typeRoots`) apply to which files in a project. ## Use Cases My project's `src` folder contains both `.ts` and `.test.ts` files, and I'd like an easy way for globals like `describe` to be defined only for the `.test.ts` files. ## Examples Not sure, but maybe some sort of new options in `tsconfig.json` for specifying which `types` items, `lib` items, or `typeRoots` items apply to which files. This would be a beneficial feature because various editors (VS Code aside) look for a `tsconfig.json` file at the root of a project, and at the moment the only way to make types work in all files is to just provides all types for all files, which is undesirable because `describe` is not a function that is available in source files (as an example). Example configuration: maybe instead of a `typeRoots` array, it can be an object like: ```js "typeRoots": { "./src/**/*.test.ts": ["../path/to/test/types"], // test-only types "./src/**/*.ts": ["../path/to/@types"] // other types other files } ``` Or something. That's just an example to get the idea rolling. ## Checklist My suggestion meets these guidelines: * [x] This wouldn't be a breaking change in exis
Comments (0)
No comments yet. Start the discussion.