linter
linter copied to clipboard
Analyzer gives confusing directions (`combinators_ordering`)
Given the following code:
import 'dart:io' as io show Directory, exitCode, Platform, stderr;
The analyzer will complain:
info - engine_tool/lib/main.dart:6:24 - Sort combinator names alphabetically. Try sorting the combinator names alphabetically. - combinators_ordering
But the names are sorted alphabetically.
The fix:
import 'dart:io' as io show Directory, Platform, exitCode, stderr;
seems wrong as it isn't alphabetically sorted (P comes after e).
The analyzer should be specific that it wants you to sort according to the ascii/utf-8 value of the characters.
Or the lint should be changed to use a case-insensitive comparison.
@pq
I'd be in favor of case-insensitive comparison in this case.
making that change will probably cause a bunch of existing code to be out of spec?
It may very well. We'd want to do a bit of testing to measure impact first.
Duplicate of https://github.com/dart-lang/linter/issues/3866