Skip to content

[Feature]: baseUrl已被弃用,并且将在 TypeScript 7.0 中停止工作。 #121

@HyperCherry

Description

@HyperCherry

Is your feature request related to a problem?

Visual Studio Code中打开项目时得到如下的错误提示

Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
  Visit https://aka.ms/ts6 for migration information.

"baseUrl": ".",

Describe the solution you'd like

在TypeScript的6.0 Migration Guide中,已经说明缘由,并给出了一种迁移方案

npx @andrewbranch/ts5to6 --fixBaseUrl .

执行此脚本后将自动将tsconfig.josn修改为:

"paths": {
    "@assets/*": ["./src/assets/*"],
    "@i18n/*": ["./src/i18n/*"],
    "@constants/*": ["./src/constants/*"],
    "@utils/*": ["./src/utils/*"],
    "@components/*": ["./src/components/*"],
    "@pages/*": ["./src/pages/*"],
    "@layouts/*": ["./src/layouts/*"],
    "@styles/*": ["./src/styles/*"],
    "@/*": ["./src/*"],
},

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions