Disable dead code hints

Hey all, I’m using VSCode. Is it possible to disable dead code warnings in-editor at least temporarily (and globally) without the need for the @dead decorator? It’s an awesome feature but it can be a little overbearing at times.

1 Like

Check out the Warning Numbers section of the docs, you can disable specific warnings inside your rescript.json using the number

{
  "warnings": {
    "numbers": "-27"
  }
}

Maybe you’re talking about the code analyzer powered by reanalyze? If so, you can just turn it off, something like > Stop Code Analyzer. There’s also a config option to run it automatically that you might’ve accidentally enabled. If so, just disable it.

1 Like

I wonder if @thislogancall is looking for something like @dead or @live decorators.

My intention is to use @live in a dependency library. This library is commonly imported in most of my rescript projects. However, when I reanalyze the code of the library separately, I often receive warnings for unused code although that the code is being used in my other projects.

Is there a better way to avoid this sort of code warnings?

1 Like

@zooshme I’ve used @dead but i want to disable it globally for now. Using the reanalyze config to suppress everything worked per @zth’s suggestion. Like so:

rescript.json

  "reanalyze": {
    "suppress": ["src"]
  },
2 Likes