不要な文字列エスケープ
文字列内の不要なバックスラッシュを削除します。
このルールはDart 2.8以降で使用できます。
このルールにはクイックフィックスが用意されています。
詳細
#文字列内の不要なバックスラッシュを削除します。
悪い例
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
特に明記されていない限り、このサイトのドキュメントはDart 3.5.3を反映しています。ページの最終更新日:2024年7月3日。 ソースを表示 または 問題を報告する