目录

prefer_adjacent_string_concatenation

Use adjacent strings to concatenate string literals.

此规则自 Dart 2.0 版本起可用。

_规则集:recommended , flutter _

此规则提供 快速修复

详情

#

DO use adjacent strings to concatenate string literals.

BAD:

dart
raiseAlarm(
    'ERROR: Parts of the spaceship are on fire. Other ' +
    'parts are overrun by martians. Unclear which are which.');

GOOD:

dart
raiseAlarm(
    'ERROR: Parts of the spaceship are on fire. Other '
    'parts are overrun by martians. Unclear which are which.');

使用方法

#

要启用 prefer_adjacent_string_concatenation 规则,请在你的 analysis_options.yaml 文件中,在 linter > rules 下添加 prefer_adjacent_string_concatenation

analysis_options.yaml
yaml
linter:
  rules:
    - prefer_adjacent_string_concatenation