Lint request: A single “set” of “effective Dart” lints

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).

Author: Fantashit

1 thought on “Lint request: A single “set” of “effective Dart” lints

  1. You can include one analysis options file in another by having a top level key of includes: whose value is the URI of the analysis_options.yaml file to be included.

    I suspect that facility satisfies this issue, so I’m closing it.

Comments are closed.