Skip to content
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

Type definitions not automatically found by the compiler #17

Closed
Tompouce-onGit opened this issue Dec 28, 2019 · 5 comments
Closed

Type definitions not automatically found by the compiler #17

Tompouce-onGit opened this issue Dec 28, 2019 · 5 comments

Comments

@Tompouce-onGit
Copy link

After installing the type definitions with npm install --save-dev @types/p5, typing some p5 code into the latest version of vscode doesn't show any intellisense types. This suggests that the typescript compiler can't find the definitions under ./node_modules/@types/p5.

I know explicitly including references at the top of each file will work, but this seems like a noteworthy issue.

@Zalastax
Copy link
Member

I believe it used to work. Where are other typings installed?

@vinkla
Copy link

vinkla commented Mar 3, 2020

Referenced issue from p5.js repository: processing/p5.js#1339 (comment)

Is there anything we can do to make the types available globally when the npm package is installed?

@Zalastax
Copy link
Member

Zalastax commented Mar 3, 2020

I unfortunately don't know.

@marlemie
Copy link

Just a note from my side: using p5 version 1.0.0 and @types/p5 version 0.9.1 works well.
In case it matters: I am using ES6 import syntax.

@antiboredom
Copy link
Contributor

Hi @vinkla

I've been trying to find a nice way to incorporate this into my p5 vscode extension. Have not quite figured out the best way yet, but did discover that you can add the types globally to a project by creating a jsconfig.json file and adding this to it:

{
  "include": [
    "*.js",
    "libraries/*.js",
    "node_modules/@types/p5/global.d.ts"
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants