-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Salsa: Include declaration files in different directories #13213
Comments
Did you add path mapping? have you added them in the |
Yes, I added "declarations/node-foo.d.ts" or "declarations" or "declarations/*" but nothing worked. I originally had no "include" or "files" and I think this should include every file. {
"compilerOptions": {
"target": "es2015"
},
"typeAcquisition": {
"enable": true
// tried include here too
}
// tried include here
} |
can you share a sample i can look at? |
Sorry for late response! I made a sample here: https://github.com/SaschaNaz/salsa-dts-sample/ Moving |
thanks @saschanaz. I am a bit confused about what you want to do in i would say you should just stick with a modul, e.g. /// declarations/es-cancelable.d.ts
import * as PG from "pg";
export class Foo {
...
} and in your jsonfig.json add {
"compilerOptions": {
"target": "es2015",
"baseUrl": "./",
"paths": {
"*" :["declarations/*", "*" ]
}
},
"typeAcquisition": {
"enable": true
}
} then you should see: |
Great, now it works as expected! The BTW, how can I turn on d.ts type checker with |
errors are disabled if you are using a jsconfig.json. we should be enabling more of htese errors as part of #6802 |
the easiest way is to add a tsconfig.json on this folder, and open the files from this folder first. also running |
TypeScript Version: nightly (2.2.0-dev.20161229)
Situation
I have an existing project written in pure JS. My file tree:
I want to add some node module declaration files for my private node modules. I added the modules on my package.json as
git+ssh
form to directly get them from git repositories. They are written in pure JS, so now I want to write some TS declaration for typing.Expected behavior:
I should be able to include d.ts files from arbitrary directories as I can with TS project.
Actual behavior:
Salsa acquire types only from files within same directory ("sources" here).
The text was updated successfully, but these errors were encountered: