How to disable strict_raw_type and inference_failure_on_function_return_type from analysis_option.yaml on Flutter?

huangapple go评论64阅读模式
英文:

How to disable strict_raw_type and inference_failure_on_function_return_type from analysis_option.yaml on Flutter?

问题

我有很多警告,来自Dart分析器的strict_raw_typeinference_failure_on_function_return_type

我尝试将规则传递给analysis_option.yaml

linter:
  rules:
    strict_raw_type: false
    inference_failure_on_function_return_type: false

但它说这些不被识别为lint规则。

我如何禁用这些规则?

我使用very_good_analysis包来进行代码检查。

英文:

I have a lot of warnings with strict_raw_type and inference_failure_on_function_return_type from the dart analyzer.

I tried to pass to the analysis_option.yaml the rules:

linter:
  rules:
    strict_raw_type: false
    inference_failure_on_function_return_type: false

But it says that are not recognized as lint rules.

How can I disable these rules?

I use very_good_analysis package for lints.

答案1

得分: 0

我找到了解决方案:

我在 analyzer 下添加了以下内容:

  language:
    strict-raw-types: false

并且我还在 analyzer 下添加了一些错误规则:

  errors:
    inference_failure_on_function_return_type: ignore
    inference_failure_on_untyped_parameter: ignore
    inference_failure_on_instance_creation: ignore
    inference_failure_on_function_invocation: ignore
英文:

I found the solution:

I added under analyzer:

  language:
    strict-raw-types: false

And also I added some error rules under analyzer:

  errors:
    inference_failure_on_function_return_type: ignore
    inference_failure_on_untyped_parameter: ignore
    inference_failure_on_instance_creation: ignore
    inference_failure_on_function_invocation: ignore

huangapple
  • 本文由 发表于 2023年5月11日 16:42:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76225713.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定