flutter - 如何删除 Dart/Flutter 项目的 todo 静态分析?

标签 flutter dart visual-studio-code

Dart 和 Flutter 有一个静态分析 linter/工具。大多数时候我觉得它很有用,除了 TODO我的代码中的注释。我有一种不同的方式来跟踪我在代码中的待办事项(除了静态分析工具)。
如何对我的所有待办事项评论禁用此分析?我也不想为每个项目添加忽略语句 ( ignore: todo ),如下所示。
例子:

// I don't want to have to do this every time.

// ignore: todo
// TODO: implement rest of class
class SomeClass {
    Object someValue;
}

最佳答案

解决方案在 Linter for Dart: Ignoring rules (page) .
您需要添加 analysis_options.yaml目录根目录下的 file 选项并添加以下规则:analysis_options.yaml

analyzer:
  errors:
    todo: ignore

归功于 pskink让我看两次页面(来自评论部分)。

dart.dev/guides/language/analysis-optionspskink

关于flutter - 如何删除 Dart/Flutter 项目的 todo 静态分析?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64613639/

相关文章:

Flutter - Navigator.push() 在扩展 State<Main> 上给出错误 "Context does not include a Navigator"

swift - Flutter Desktop : Firebase Auth could not find a valid GoogleService-Info. plist

flutter - 每次在 Flutter 中初始化时,将参数传递给 Riverpod 提供程序的有效方法是什么?

firebase - Flutter Firebase如何使用Google登录用户

visual-studio-code - 这些 yaml.customTags 从哪里来的 vs 代码

python - VS代码中的文件夹

android - 使用 build apk 命令构建的 Flutter 应用程序无法运行特定于平台的代码

Dart 类型错误 : type is not a subtype of type Null

visual-studio-code - 仅在安装C#扩展时VSCode无法检测到安装

android - 如何在 flutter 的角落添加图像?