Skip to content

noUnusedLocals doesn't respect the jsxFactory from tsconfig.json #14109

Description

@fspillner

TypeScript Version: 2.1.6

Code

import preact = require('preact');

// JSX component
export default (
  <div>Foobar</div>
);

tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "jsx": "React",
    "jsxFactory": "preact.h",
    "module": "commonjs",
    "moduleResolution": "node",
    "target": "es2015",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": true,
    "noUnusedParameters": true,
    "noUnusedLocals": true,
    "typeRoots": [ "node_modules/@types", "source/ts/types" ],
    "lib": [ "dom", "es6", "dom", "scripthost" ]
  },
  "exclude": [
    "node_modules",
    "target"
  ]
}

Expected behavior:

No error

Actual behavior:

Error TS6133: 'preact' is declared but never used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitter

    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