Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Disabling a TSLint rule makes VS Code shut up about it, but still blocks build #367

Closed
@TomasHubelbauer

Description

@TomasHubelbauer

Is this a bug report?

Yep.

Can you also reproduce the problem with npm 4.x?

Not applicable.

Which terms did you search for in User Guide?

tslint, but this guide is from the JS CRA, which doesn't apply to TS issues…

Environment

  1. npm ls react-scripts-ts react-scripts-ts@2.16.0
  2. node -v: v8.9.3
  3. npm -v: 5.5.1
  4. yarn --version 1.7.0
  5. npm ls react-scripts-ts Why is this here twice?

Then, specify:

  1. Operating system: Windows
  2. Browser and version (if relevant): irrelevant

Steps to Reproduce

Scaffold a project using this tool, then go to App.tsx and type in this:

type AppProps = {};
type AppState = {};

and change React.Component to React.Component<AppProps, AppState>.

VS Code's TSLint extension (if installed) will complain about the interface-over-type-literal rule. This is a questionable rule, so let's disable it in tslint.json:

{
  "extends": [
    "tslint:recommended",
    "tslint-react",
    "tslint-config-prettier"
  ],
  "linterOptions": {
    "exclude": [
      "config/**/*.js",
      "node_modules/**/*.ts"
    ],
    "rules": {
      "interface-over-type-literal": false
    }
  }
}

Restart VS Code just in case. Now the TS Lint extension is cool, but running yarn start gives a runtime exception:

Failed to compile

src/App.tsx
(7,6): Use an interface instead of a type literal.

This error occurred during the build time and cannot be dismissed.

Expected Behavior

This is definitely not an error, so this should not error and it should instead respect the reasonable request to disable the darn rule. It seems like react-scripts-ts doesn't read tslint.json correctly or something, but I think my tslint.json syntax is okay as it did shut up the VS Code extension.

Actual Behavior

Failed to compile

src/App.tsx
(7,6): Use an interface instead of a type literal.

This error occurred during the build time and cannot be dismissed.

Reproducible Demo

See steps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions