Coder Social home page Coder Social logo

Comments (9)

wolfy1339 avatar wolfy1339 commented on June 2, 2024 1

That isn't a viable solution. The types are autogenerated from our JSON schema

from webhooks.

wolfy1339 avatar wolfy1339 commented on June 2, 2024

Can you share your tsconfig?

If you don't have strict enabled, it resolves to never

from webhooks.

chris-feist avatar chris-feist commented on June 2, 2024

I have the default setting for strict. Here is my config:

// tsconfig.json
{
  "extends": "./tsconfig.paths.json",
  "compilerOptions": {
    "lib": ["ESNext"],
    "moduleResolution": "node",
    "removeComments": true,
    "sourceMap": true,
    "target": "ESNext",
    "outDir": "lib",
    "skipLibCheck": true
  },
  "include": ["src/**/*.ts", "serverless.ts"],
  "exclude": [
    "node_modules/**/*",
    ".serverless/**/*",
    ".webpack/**/*",
    "_warmup/**/*",
    ".vscode/**/*"
  ],
  "ts-node": {
    "require": ["tsconfig-paths/register"]
  }
}
// tsconfig.paths.json
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@functions/*": ["src/functions/*"],
      "@languages/*": ["src/languages/*"],
      "@src/*": ["src/*"],
      "@utils/*": ["src/utils/*"]
    }
  }
}

from webhooks.

wolfy1339 avatar wolfy1339 commented on June 2, 2024

At the very minimum, we require that the strictNullChecks be enabled.

The default value for strict is false (which includes strictNullChecks)

from webhooks.

chris-feist avatar chris-feist commented on June 2, 2024

Is there a reason for not updating the type to support both tsconfig options?

from webhooks.

wolfy1339 avatar wolfy1339 commented on June 2, 2024

Even with that change, you still need strictNullChecks in order to use the types.

from webhooks.

wolfy1339 avatar wolfy1339 commented on June 2, 2024

See #395 also for more info

from webhooks.

chris-feist avatar chris-feist commented on June 2, 2024

While I can confirm that strictNullChecks: true does remove the error, my suggestions also remove the error. If you wanted to force suspended_at and suspended_by to null, then the Omit approach I suggested would be the best path forward. I put together this example:

https://stackblitz.com/edit/typescript-4gwo1b?file=index.ts

from webhooks.

chris-feist avatar chris-feist commented on June 2, 2024

Okay, makes sense then

from webhooks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.