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.

Fails to recompile with custom tslint rules #250

Open
@doomsower

Description

@doomsower

It's either something wrong with my tslint.json (which used to work before I upgraded many packages) or it's a bug.

Is this a bug report?

Yes

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

Yes

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

  1. npm ls react-scripts-ts (if you haven’t ejected): 2.13.0
  2. node -v: v8.9.4
  3. npm -v: 5.6.0
  4. yarn --version (if you use Yarn): 1.3.2
  5. npm ls react-scripts-ts (if you haven’t ejected): 2.13.0

Then, specify:

  1. Operating system: MacOS 10.13.3
  2. Browser and version (if relevant):

Steps to Reproduce

I tried to reproduce this with blank project, but was unable to do so. Here is what's going on in my project:

I have custom tslint.json file:

{
    "extends": ["tslint:latest", "tslint-react", "tslint-eslint-rules"],
    "rules": {
        "arrow-parens": false,
        "arrow-return-shorthand": [false],
        "brace-style": [ true, "1tbs", { "allowSingleLine": true}],
        "comment-format": [true, "check-space"],
        "import-blacklist": [true, "rxjs"],
        "interface-name": false,
        "jsx-boolean-value": [true, "never"],
        "jsx-no-multiline-js": false,
        "member-access": false,
        "member-ordering": [true, {"order": "statics-first"}],
        "newline-before-return": false,
        "no-any": false,
        "no-empty": [true, "allow-empty-catch"],
        "no-console": [true, "log"],
        "no-inferrable-types": [true],
        "no-implicit-dependencies": [true, "dev"],
        "no-import-side-effect": [true, {"ignore-module": "(\\.html|\\.css)$"}],
        "no-invalid-this": [true, "check-function-in-method"],
        "no-null-keyword": false,
        "no-require-imports": false,
        "no-submodule-imports": [true, "material-ui", "lodash", "raf", "redux-persist"],
        "no-switch-case-fall-through": true,
        "no-trailing-whitespace": true,
        "no-unused-variable": [true, "react"],
        "object-curly-spacing": [true, "always"],
        "object-literal-sort-keys": false,
        "only-arrow-functions": [true, "allow-declarations"],
        "ordered-imports": [ true, { "import-sources-order": "case-insensitive", "named-imports-order": "case-insensitive"}],
        "prefer-method-signature": false,
        "prefer-template": [true, "allow-single-concat"],
        "quotemark": [true, "single", "jsx-double"],
        "semicolon": [true, "always", "ignore-bound-class-methods"],
        "triple-equals": [true, "allow-null-check"],
        "typedef": [true,"parameter", "property-declaration", "member-variable-declaration"],
        "variable-name": [true, "ban-keywords", "check-format", "allow-pascal-case", "allow-leading-underscore"]
    },
    "defaultSeverity": "warning"
}

and in devDependencies i have

    "ts-jest": "^22.0.3",
    "tslint": "^5.8.0",
    "tslint-eslint-rules": "^4.1.1",
    "tslint-react": "^3.2.0",
    "typescript": "2.7.1",

Expected Behavior

I run yarn start, the project compiles. Then I add newline to some .ts file, project recompiles without errors.

Actual Behavior

Here is the output of yarn start > log.txt:

yarn run v1.3.2
$ react-scripts-ts start
Failed to load tsconfig.json: Missing baseUrl in compilerOptions
Found no baseUrl in tsconfig.json, not applying tsconfig-paths-webpack-plugin
Found no baseUrl in tsconfig.json, not applying tsconfig-paths-webpack-plugin
Starting type checking and linting service...
Using �[1m1 worker�[22m with �[1m2048MB�[22m memory limit
Watching: �[90m/Users/doomsower/projects/porjectname/web/src�[39m
Starting the development server...

ts-loader: Using typescript@2.7.1 and /Users/doomsower/projects/porjectname/web/tsconfig.json
Compiled with warnings.

... warnings

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

Compiling...
Failed to compile.

/Users/doomsower/projects/porjectname/web/node_modules/@types/draft-js/index.d.ts
(14,28): Cannot find module 'immutable'.

The project compiles and starts at first, but any change leads to recompile failure.

However, if I change content of tslint.json to default that comes with create-react-app-typescript and add "defaultSeverity": "warning", everything compiles and recompiles just fine.

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

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