Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsc报错error TS7029: Fallthrough case in switch. #40

Closed
caocong1 opened this issue Mar 11, 2024 · 4 comments
Closed

tsc报错error TS7029: Fallthrough case in switch. #40

caocong1 opened this issue Mar 11, 2024 · 4 comments

Comments

@caocong1
Copy link

https://github.com/guMcrey/version-rocket/blob/2111135aea012220c14e028c24cd0b02873ab6fe/utils/index.ts#L147-L49

switch (cancelModeType) {
    case 'ignore-current-version':
      if (newVersion && cancelModeTypeValue === newVersion) {
        isStopWorker && worker?.terminate()
        return true
      }
+     break
    case 'ignore-today':
      if (cancelModeTypeValue === todayDate) {
        isStopWorker && worker?.terminate()
        return true
      }
      break
    case 'ignore-current-window':
      if (cancelModeTypeValueInSession) {
        isStopWorker && worker?.terminate()
        return true
      }
      break
    default:
      break
  }

在case 'ignore-current-version':里缺少一个break

@guMcrey
Copy link
Owner

guMcrey commented Mar 11, 2024

收到, 谢谢你的反馈, 我会尽快修复的♥️

@guMcrey
Copy link
Owner

guMcrey commented Mar 11, 2024

@caocong1 你好呀, 想问下 "tsc报错error TS7029: Fallthrough case in switch" 这个报错是在什么情况下触发的呢?

@caocong1
Copy link
Author

@caocong1 你好呀, 想问下 "tsc报错error TS7029: Fallthrough case in switch" 这个报错是在什么情况下触发的呢?

tsconfig.json里配置noFallthroughCasesInSwitch这个就会提示这个错误。

{
  "compilerOptions": {
    ...
    "strict": true,
    "noFallthroughCasesInSwitch": true
  },
  ...
}

@guMcrey
Copy link
Owner

guMcrey commented Mar 13, 2024

收到, 修复啦

@guMcrey guMcrey closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants