non_constant_identifier_names
使用 lowerCamelCase 為非常數識別符命名。
此規則自 Dart 2.0 起可用。
此規則具有可用的快速修正。
詳細資訊
#應該使用 lowerCamelCase 為非常數識別符命名。
類別成員、頂層定義、變數、參數、具名參數和具名建構子應該將每個單字的首字母大寫,除了第一個單字外,且不使用分隔符號。
良好
dart
var item;
HttpRequest httpRequest;
align(clearItems) {
// ...
}
用法
#若要啟用 non_constant_identifier_names
規則,請在 analysis_options.yaml
檔案中的 linter > rules 下新增 non_constant_identifier_names
。
analysis_options.yaml
yaml
linter:
rules:
- non_constant_identifier_names
除非另有說明,否則本網站上的文件反映的是 Dart 3.6.0。頁面最後更新於 2024-07-03。 檢視原始碼或回報問題。