Skip to content

Use Solution Style tsconfig.json Files #17758

Description

@xiaoxiangmoe

🚀 Feature request

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Description

Current, we can use describe, it, test, expect in app. Because we use "types": ["jasmine","node"] in tsconfig.json. And this is for tsconfig.spec.json, not for tsconfig.app.json.

In order to get a better IDE experience, we can use “Solution Style” tsconfig.json Files in TypeScript 3.9

// tsconfig.json
{
  "files": [],
  "references": [
    { "path": "./tsconfig.app.json" },
    { "path": "./tsconfig.spec.json" },
  ]
}
{
  // tsconfig.app.json
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "es2020",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "lib": [
      "es2018",
      "dom"
    ],
    "types": []
  },
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "src/**/*.d.ts"
  ]
}
{
  //tsconfig.spec.json
  "extends": "./tsconfig.app.json",
  "compilerOptions": {
    "outDir": "./out-tsc/spec",
    "types": [
      "jasmine",
      "node"
    ]
  },
  "files": [
    "src/test.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "src/**/*.spec.ts",
    "src/**/*.d.ts"
  ]
}

Activity

  1. alan-agius4 commented on May 19, 2020

    @alan-agius4
    Collaborator

    Hi @xiaoxiangmoe,

    Kindly search for open issues and PRs, before opening a new one.

    There is already a PR for this #17586 and is very close to get landed.

    Thanks.

  2. angular-automatic-lock-bot commented on Jun 19, 2020

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  3. locked and limited conversation to collaborators on Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions