Skip to content

Lint request: A single "set" of "effective Dart" lints #32612

Closed
@matanlurey

Description

@matanlurey

Forked from #32596 (comment).

AngularDart (and internally at Google) requires a better process for identifying, testing, and using lints than the one currently used right now (i.e. many varied contributions without requirements they conform with the style guide - often they are inventing style guide requirements that do not exist).

i.e. I'd like to be able to write (or similar):

# analysis_options.yaml
linter: google # Use the Google style guide set of lints.

Internally, we might need a transitional set of lints that are not quite all of them:

# analysis_options.yaml
linter: google-relaxed

Here are our requirements:

  1. The internal style team determines what lints match both google and google-relaxed. It's likely most of these lints already exist, but we should double check the implementations. We'd be linting 10s of millions of lines of code, so we need the quality bar to the extremely high (internally lints with a false-positive rating of >=0.5% are automatically disabled).
  2. Automated performance testing avoids issues around IDE crashes or slowdowns.
  3. As lints are added to this list, we have adequate time to vet them on large code bases.
  4. Lints that are optional (i.e. prefer) need to be excluded on existing code - i.e. we don't want to force teams to have to write hundreds of // ignore: x_x_x because they didn't follow an optional rule.

Nice to have externally (we do this internally already):

  1. Lints can be enabled "just-in-time" - i.e. for presubmit/code review (instead of always on). This is probably a requirement for 4. above, anyway, because otherwise we wouldn't have context on whether code is "new" or not.

/cc @JekCharlsonYu., @davidmorgan (who is working on internal linting).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).legacy-area-analyzerUse area-devexp instead.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions