Skip to content

Deprecate no_adjacent_strings_in_list, replacing with no_adjacent_strings_in_collections #58437

@srawlins

Description

@srawlins

Describe the rule you'd like to see implemented

We should replace no_adjacent_strings_in_list with a new lint rule, no_adjacent_strings_in_collections, which would catch adjacent strings in sets, lists, if-elements, and for-elements.

Examples

[
  if (1 == 2) 'a' // LINT
  'b'
];

[
  for (var v in []) 'a' // LINT
  'b'
];

Additional context

It would be a breaking change to add if-collection and for-collection support to no_adjacent_strings_in_list (dart-archive/linter#2726). It would not make naming sense to add set support to that existing rule, and also be a breaking change.

I can't conceive of a reason someone would want adjacent strings reported in lists but not sets, or vice versa, so it makes sense to put them in one rule.

Metadata

Metadata

Assignees

No one assigned

    Labels

    devexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions