I'm currently using the pedantic
package for my dart/flutter linting.
My analysis_options.yaml
look like
include: package:pedantic/analysis_options.yaml
linter:
rules:
always_specify_types: true
omit_local_variable_types: false
I like having to specify types when I declare a variable line. But with this, I have to also specify the type on the created list/map.
The issues I have are the parts within **
const int number = 5;
const bool isTrue = false;
const String myName = 'Dan';
const List<int> numbers = **<int>**[1, 2, 3, 4];
const Map<String, int> ages = **<String, int>**{'Dan': 1};
It's redundent. How can I set my analysis_options.yaml to fix this.
Thanks!
question from:
https://stackoverflow.com/questions/65853297/how-can-i-disable-requiring-types-for-collection-literals-in-dart 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…