目次

不要な文字列エスケープ

文字列内の不要なバックスラッシュを削除します。

このルールはDart 2.8以降で使用できます。

ルールセット:推奨flutter

このルールにはクイックフィックスが用意されています。

詳細

#

文字列内の不要なバックスラッシュを削除します。

悪い例

dart
'this string contains 2 \"double quotes\" ';
"this string contains 2 \'single quotes\' ";

良い例

dart
'this string contains 2 "double quotes" ';
"this string contains 2 'single quotes' ";

使用方法

#

unnecessary_string_escapesルールを有効にするには、analysis_options.yamlファイルの**linter > rules**の下にunnecessary_string_escapesを追加します。

analysis_options.yaml
yaml
linter:
  rules:
    - unnecessary_string_escapes