Jump to content

Typescript Linting Errors


Recommended Posts

A basic code like this will throw an error in the linter:

scene.activeCamera.alpha += Math.PI;

My tsconfig file looks like this:

{
  "compilerOptions": {
    "target": "es5",
    "module": "esnext",
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
    "sourceMap": true,
    "noImplicitAny": true,
    "removeComments": true,
    "preserveConstEnums": true,
    "baseUrl": ".",
    "lib": ["es2015", "dom"],
    "types": ["node", "jest", "babylonjs"],
    "paths": {
      "@/*": ["src/*"]
    }
  },
  "include": ["src/**/*.ts", "src/**/*.vue", "tests/**/*.ts"],
  "exclude": ["node_modules"]
}

 

Link to post
Share on other sites

It is  because if you check the api link, again posting here (https://doc.babylonjs.com/api/classes/babylon.camera) there's no public member called as "alpha" and scene.activeCamera returns the base camera class as type. Assuming you are using ArcRotate or ArcFollow camera, refer to this PG -http://playground.babylonjs.com/ts.html#RNXXBZ  you can change the active camera and see.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...