-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Unable to override typings #11517
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
Comments
By default all the files in You can override what types to include by setting |
Ok, yes i get that and it works now somehow. But it seems i need to include the baseUrl + paths otherwise the typeRoots + types seem to have no effect. The following does not work and {
"compilerOptions": {
"target": "es5",
"typeRoots": [
"types"
],
"types": [
"react"
]
},
"files": [
"index.ts"
]
} This does work somehow. {
"compilerOptions": {
"baseUrl": "",
"paths": {
"*": [
"types/*"
]
},
"target": "es5",
"typeRoots": [
"types"
],
"types": [
"react"
]
},
"files": [
"index.ts"
]
} |
I also noticed that global augmentation is being resolved as a module. Is this correct?
|
@mhegazy This issue may be closed as the original problem has been somewhat solved. If you don't have any thoughts about my two last comments feel free to shut this one down. |
nope. this is a bug. thanks for the report. filed #11754 to track it. |
yes. issue #11137 tracks fixing this. we should have a fix for this soon. |
I'm having trouble redirecting the lookup of certain typings to a custom directory. The reason i want this is because when i find an error in an at-types module and i issue a pull-request, it usually takes a while before it is reviewed, merged and published etc. In the meanwhile i want to use the version that i modified until the fix is merged and i can depend on the original at-types module again.
I would copy the
@types/<package-name>/index.d.ts
to a custom directory and edit that. Then i would remove the dependency by removing it a-lanpm rm @types/<package-name>
In the case where no other packages depend on that same at-types package this works fine but the problem surfaces when one does depend on that same module that i edited.
TypeScript Version: 2.0.3
Let's say we have a project called temporary-types.
temporary-types/package.json
temporary-types/tsconfig.json
temporary-types/index.ts
temporary-types/types/react/index.ts
// This file can be modified but for simplicity contains the exact same contents as the original @types/react/index.d.ts file.
If i compile this i get the following result:
I guess it could work if i do the same thing to all the packages that depend on the modified package and then recursively but this is not a solution.
PS: This issue probably needs a better title.
The text was updated successfully, but these errors were encountered: