-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Description
🔍 Search Terms
create primitive to prevent one folder from importing from another folder
when importing from a blacklisted folder it would represent a compile error
this would help a lot more people than you think, mostly for server/client interfacing
✅ Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
configuration in tsconfig.json that prevents one folder from importing another
in tsconfig.json
[
{
folder: '',
cannotImport: [],
canOnlyImport: []
}
]it could also be at the file level, but folder level sufficient
📃 Motivating Example
configuration in tsconfig.json that prevents one folder from importing another
in tsconfig.json
[
{
folder: '',
cannotImport: [],
canOnlyImport: []
}
]it could also be at the file level, but folder level sufficient
💻 Use Cases
- What do you want to use this for?
- What shortcomings exist with current approaches?
- What workarounds are you using in the meantime?
Metadata
Metadata
Assignees
Labels
No labels