vuejs/vue-cli

Type checking ignores script-setup blocks

Open

#6,716 创建于 2021年10月1日

在 GitHub 查看
 (13 评论) (0 反应) (0 负责人)JavaScript (29,754 star) (6,328 fork)batch import
help wanted

描述

Version

5.0.0-beta.4

Reproduction link

github.com

Environment info

  System:
    OS: Linux 5.14 Arch Linux
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  Binaries:
    Node: 16.10.0 - /usr/bin/node
    Yarn: 1.22.4 - ~/.local/bin/yarn
    npm: 7.24.1 - /usr/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 92.0.1
  npmGlobalPackages:
    @vue/cli: 5.0.0-beta.4

Steps to reproduce

vue create vue-cli-script-setup-lang-ts-typechecks -bi '{
      "useConfigFiles": false,
      "plugins": {
        "@vue/cli-plugin-typescript": {
          "classComponent": false
        }
      },
      "vueVersion": "3"
    }'
cd vue-cli-script-setup-lang-ts-typechecks

Add some wrongly typed code. E.g.:

echo '<script setup lang="ts">const x: string = 42;</script>' >> src/App.vue

Build

npm run build

What is expected?

The typescript error is detected and the build fails.

What is actually happening?

The typing is simply stripped and no error can be seen.

贡献者指南

Type checking ignores script-setup blocks · vuejs/vue-cli#6716 | Good First Issue