GithubHelp home page GithubHelp logo

rush-tsconfig-example's Introduction

rush-tsconfig-example

Example project to demonstrate issue with tsconfig.json for WEB-30677

Usage

  1. npm install -g @microsoft/rush
  2. rush install (inside repo dir)

The issue

When the tsconfig.json is not in the project root, WebStorm/PhpStorm does not find/use the tsconfig.json on a per project basis for Typescript source located in that project (eg: project/tsconfig.json)

In this repo, the IDE Typescript service reports and error that foo.ts is not included in any tsconfig.json, when it is included via/in project/tsconfig.json

Discussion on the YouTrack issue suggests other people have had different errors with the IDE Typescript service when the tsconfig.json is not in the project root.

This is a problem especially in monorepos where you can want different tsconfig.json per project in order to have different options/configuration. The IDE project root in a monorepo is not a project itself unlike in traditional project repos.

The workaround

The current workaround is to specify in the IDE Typescript options the specific tsconfig.json that applies for the project's source that is being edited ie: --p project/tsconfig.json.

This is a very annoying workaround as if projects in the monorepo have different configurations, a developer will have be changing this option as they change between projects to stop the IDE reporting errors.

Proposed solution

When editing a source file in a directory the closest tsconfig.json to that file is the one used with the Typescript service.

rush-tsconfig-example's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.