一键导入
dart-long-lines
Guidelines for handling long lines in Dart code to adhere to the 80-column rule. The `lines_longer_than_80_chars` lint.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guidelines for handling long lines in Dart code to adhere to the 80-column rule. The `lines_longer_than_80_chars` lint.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | dart-long-lines |
| description | Guidelines for handling long lines in Dart code to adhere to the 80-column rule. The `lines_longer_than_80_chars` lint. |
| license | Apache-2.0 |
| key_features | ["80-column rule compliance","Line length refactoring","Linter rule enforcement"] |
Use this skill when:
lines_longer_than_80_chars lint.
Reference: https://dart.dev/tools/linter-rules/lines_longer_than_80_charsTo find lines that exceed the limit:
The most reliable way to find long lines is to use the Dart analyzer:
dart analyzelines_longer_than_80_charsTo search for long lines using regex:
^.{81,}$ (Matches any line with 81 or more characters).Always run dart format before manually breaking long lines. The formatter
often automatically fixes long lines, especially in generated code, and
applies standard Dart styling rules.
Break long code comments (//) cleanly at word boundaries to ensure lines do
not exceed 80 characters. Maintain tight formatting and avoid unnecessary
vertical space.
///)[name] or
[text](http://example.com) across lines. Place them on their own line if
they exceed the limit.'part 1 ' 'part 2') to break long
strings. Break at word boundaries.\n) or if there are
consecutive print statements, consider migrating to a multi-line string
literal (''').dart format and dart analyze after making changes.prefer_single_quotes if a double-quoted string is split into parts that
no longer contain single quotes).Avoid:
/// This is a long doc comment that contains a link to [a very long
/// URL](http://example.com/very/long/url/that/exceeds/eighty/chars).
Prefer:
/// This is a long doc comment that contains a link to [a very long URL][ref].
///
/// [ref]: http://example.com/very/long/url/that/exceeds/eighty/chars
Prefer:
final longString = 'This is a very long string that needs to be broken '
'across multiple lines to stay under the limit.';
Avoid:
print('This is line 1\nThis is line 2 that is also quite long\nThis is line 3 which makes the whole thing exceed eighty characters');
Prefer:
print('''This is line 1
This is line 2 that is also quite long
This is line 3 which makes the whole thing exceed eighty characters''');
Profile Dart command-line applications using the VM Service protocol to capture CPU samples and identify performance bottlenecks. Helps agents automate CPU profiling, generate function call breakdown summaries, and export JSON profiles without a browser or DevTools.
General best practices for Dart development. Covers code style, effective Dart, and language features.
Best practices for validating Dart documentation comments. Covers using `dart doc` to catch unresolved references and macros.
Best practices for using `expect` and `package:matcher`. Focuses on readable assertions, proper matcher selection, and avoiding common pitfalls.
Guidelines for using modern Dart features (v3.0 - v3.10) such as Records, Pattern Matching, Switch Expressions, Extension Types, Class Modifiers, Wildcards, Null-Aware Elements, and Dot Shorthands.
Guidelines and best practices for refactoring consecutive prints, single-line string concatenations, and complex output blocks into triple-quoted multi-line string literals (''' or """) in Dart.