The non_constant_identifier_names should likely ignore a leading underscore. For methods names like void _checkAssignment_recursion(), I see:
info: Name non-constant identifiers using lowerCamelCase. (non_constant_identifier_names at [nnbd_migration] lib/src/edge_builder.dart:3313)
Also, the code for the lint is non_constant_identifier_names, which seems like it describes the items it applies to, instead of what it does (like 'prefer_lower_camel_case').
I agree that a leading underscore should be ignored.
Side note on naming: Yes, it's unfortunate that the lint names don't all conform to a standard naming scheme. If it weren't for the pain it would cause users I'd suggest renaming them all more consistently, but I can't convince myself that it would be a net positive from a user perspective. But we realized awhile back that we'd made a mistake by using "prefer", "avoid" and other terms from the style guide because the style guide has, in a few cases, changed since the lints were originally named and now the names are inconsistent.
The issue w/ lint naming inconsistency bothers me daily. I really wish we'd been more principled and consistent but as Brian points out, our ideas have evolved. Thinking ahead, it'd be cool to do a renaming at some point but so far the pain hasn't seemed worth it. (Maybe we can revisit if bulk fixing takes off?) (FWIW there's some related discussion in #1179.)
As for this lint misfiring, my sense is that it should be further expanded to allow for underscores in function declarations too (and am somewhat baffled that it hasn't already...) Thoughts?
If there are a few lint names that really stand out, we could rename them to get a better sense for the cost to the ecosystem. We'd likely want to do something like have two names for the lint - the new and the deprecated old - show a deprecation messages, and possibly, have a quick fix to convert from the old to the new.
That sounds like a reasonable path forward. Perhaps Phil and I can carve out a few hours to review the lint names at some point to see what the magnitude of the changes might be.
SGTM!
Taking a closer look, the issue here is not the leading underscores, it's what follows. Specifically _recursion(). To fix it, consider renaming to: _checkAssignmentRecursion().
Closing as working as intended.