0

I am trying to convert a Next JS from javascript to typescript. I am making mistakes on purposes to see if the type checking is working. e.g.

export class Knot {
  position: Vector2;
  locked: number;
  deletable: boolean;
  isLast: boolean;
  isActive: boolean;
  handles: { in: Vector2, out: Vector2 };

  constructor(position: Vector2, locked: boolean, isLast: boolean, isActive: boolean = false, deletable: boolean = true) {
    this.position = position
    this.locked = locked //0 = not locked, 1 = y is locked, 2 = x is locked, 3 = z is locked
    this.deletable = deletable
    this.isLast = isLast
    this.isActive = isActive
  }
}

if you look at the locked variable. I'm assigning a boolean to a number. It shows the error in my editor but it doesn't throw any errors when I run npm run build

I don't have this ignoreBuildErrors: true setting set anywhere. I have searched the whole project.

I am working with turborepo. Not sure if that makes any difference.

This is my tsconfig:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Next.js",
  "extends": "./base.json",
  "compilerOptions": {
    "target": "es5",
    "noImplicitAny": false,
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strictNullChecks": false,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "incremental": true,
    "esModuleInterop": true,
    "module": "esnext",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve"
  },
  "include": ["src", "next-env.d.ts"],
  "exclude": ["node_modules"]
}
Vipul Rajan
  • 494
  • 1
  • 5
  • 16

0 Answers0