Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

allowUnreachableCode has to be turned off due to third party libraries. #10233

Copy link
Copy link
@Vaccano

Description

@Vaccano
Issue body actions

This is a feature request:

I get the following error when I build my webpack project:

[default] C:\myPath\my-project\node_modules\bluebird\js\release\util.js:201:5
Unreachable code detected.
[default] Checking finished with 1 errors

This is a problem in the bluebird npm library.

But I don't want to have errors in my build. So I have to add this to my tsconfig.json to get this error to turn off:

"allowUnreachableCode": true

But that is kind of a shame, because I don't want to allow unreachable code in my code, I just don't want to see errors for unreachable code that is in my node_modules. (I can't change node_module files without messing up my autobuild.)

So:
I am seeing code in node_modules inspected for unreachable code.

What I would expect (or want) to see is that node_modules is excluded from the unreachable code inspection.

In case it matters, here is my tsconfig.json:

{
  "compilerOptions": {
    "target": "es2015",
    "module": "es2015",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "sourceMap": true,
    "allowJs": true,
    "allowUnreachableCode": true
  },
  "awesomeTypescriptLoaderOptions": {
    "doTypeCheck": true,
    "forkChecker": true,
    "useBabel": true,
    "useCache": true,
    "babelOptions": {
      "presets": ["es2015-loose-native-modules"]
    }
  },
  "exclude": [
    "node_modules",
    "dist",
    "release",
    "index.js",
    "webpack.config.js",
    "config"
  ]
}
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixedOut of ScopeThis idea sits outside of the TypeScript language design constraintsThis idea sits outside of the TypeScript language design constraintsSuggestionAn idea for TypeScriptAn idea for TypeScriptToo ComplexAn issue which adding support for may be too complex for the value it addsAn issue which adding support for may be too complex for the value it adds

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.