Warning: Cannot find parent tsconfig.json

前端 未结 4 1643
不思量自难忘°
不思量自难忘° 2021-02-18 22:53

I would like to fix the warning:

Warning: Cannot find parent tsconfig.json

in the TypeScript Errors tab in Intell

4条回答
  •  借酒劲吻你
    2021-02-18 23:17

    Try setting up include section in file tsconfig.json like in below image.
    (Note that my project's root folder is frontend and my include section is frontend/**/*).

    Of course you don't need to rename your project's root folder to frontend.
    Only the naming should match.

    It should take effect immediately after you save the tsconfig.json and open a .ts or .tsx file. If it doesn't try restarting the WebStorm/IDEA.

    And don't forget to clear the error console before testing this solution. It might cache the previous messages.

    P/S: I'm using WebStorm 2016.3.1.


    If you were using webpack together with ts-loader the above solution would cause your builds to fail. If that was the case consider this approach instead.

提交回复
热议问题