Skip to content

Put TypeScript configuration in react-scripts instead of individual project? (TS3.2+) #6053

Description

@dtinth

Is this a bug report?

No

Motivation

TypeScript 3.2, released November 29th, 2018, now uses Node.js-based resolution for tsconfig.json inheritance

TypeScript 3.2 now resolves tsconfig.jsons from node_modules. When using a bare path for the "extends" field in tsconfig.json, TypeScript will dive into node_modules packages for us.

{
    "extends": "@my-team/tsconfig-base",
    "include": ["./**/*"]
    "compilerOptions": {
        // Override certain options on a project-by-project basis.
        "strictBindCallApply": false,
    }
}

TypeScript will look for "tsconfig" field in package.json to determine the configuration file to use.

Therefore, the generated tsconfig.json could be reduced to

{ "extends": "react-scripts", "include": ["src"] }

This would further reduce configuration in create-react-app projects.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions