关于冰糕设置的问题:如何解除步骤 4 中的错误
Question regarding sorbet setup: How to unsilence the errors in step 4
在此处的文档中 https://sorbet.org/docs/adopting#step-4-fix-constant-resolution-errors 它指出:
At this point, it’s likely that there are lots of errors in our project, but Sorbet silences them by default. Our next job is to unsilence them and then fix the root causes. Empirically, there are a handful of categories of errors people encounter at this step:
但没有说明如何消除错误
我已经查看了文档,以及这里的问题和之前标记的问题。还尝试了 srb tc -h
和 srb rbi -h
命令,但到目前为止一无所获 - 这是否只是关于交换 typed: false 到其他设置之一?
答案在这里:https://sorbet.org/docs/static
However, in step (3), most kinds of errors are silenced by default, instead of being reported. To opt into more checks, we use # typed:
sigils.
所以是的,只需使用更强的严格级别,例如 true
。
它主要涉及将“typed: ignore”和“typed: false”更改为更强的东西。
如果您发现并解决了 class 问题,您可以使用 sorbet 升级 type-check 存储库中每个文件的级别
$ srb tc --suggest-typed --typed=strict --error-white-list=7022 --autocorrect
在此处的文档中 https://sorbet.org/docs/adopting#step-4-fix-constant-resolution-errors 它指出:
At this point, it’s likely that there are lots of errors in our project, but Sorbet silences them by default. Our next job is to unsilence them and then fix the root causes. Empirically, there are a handful of categories of errors people encounter at this step:
但没有说明如何消除错误
我已经查看了文档,以及这里的问题和之前标记的问题。还尝试了 srb tc -h
和 srb rbi -h
命令,但到目前为止一无所获 - 这是否只是关于交换 typed: false 到其他设置之一?
答案在这里:https://sorbet.org/docs/static
However, in step (3), most kinds of errors are silenced by default, instead of being reported. To opt into more checks, we use
# typed:
sigils.
所以是的,只需使用更强的严格级别,例如 true
。
它主要涉及将“typed: ignore”和“typed: false”更改为更强的东西。
如果您发现并解决了 class 问题,您可以使用 sorbet 升级 type-check 存储库中每个文件的级别
$ srb tc --suggest-typed --typed=strict --error-white-list=7022 --autocorrect