Логотип Lint And Style Config

Lint And Style Config

Сообщество
zakariaf
lint-and-style-config

Задаёт строгие правила для analysis_options.yaml на основе very_good_analysis: strict-casts/strict-raw-types, фиксированный набор классов ошибок, которые обычно остаются незамеченными, но должны считаться ошибками (unawaited_futures, discarded_futures, empty_catches, use_build_context_synchronously, cancel_subscriptions, close_sinks, avoid_dynamic_calls, exhaustive_cases, avoid_print), dart format как единственный источник правил форматирования пробелов, исключения для сгенерированных файлов, синхронизированные с coverage, и подавление предупреждений только для конкретных строк. Объясняет ловушку include с фиксированной версией (отсутствующий include незаметно отключает все правила), различие между повышением уровня ошибок через errors-only-re-ranks и включением линтера, а также расхождение между анализом и компиляцией sealed-switch. Используйте этот навык при редактировании analysis_options.yaml, добавлении или отключении lint, написании `// ignore:`/`// ignore_for_file:`, обновлении версии Dart SDK или very_good_analysis, настройке riverpod_lint, а также при объяснении срабатывания discarded_futures, use_build_context_synchronously, close_sinks или missing_provider_scope.

Add to TypingMind

Обзор

Издательzakariaf
РепозиторийFlutter-Skills
Название навыкаlint-and-style-config
Звёзды
64
Форки
15
Файлы в комплекте
6
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 6

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Издатель навыка на GitHub — zakariaf. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Lint And Style Config в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/zakariaf/Flutter-Skills/tree/main/skills/lint-and-style-config
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills.git /tmp/Flutter-Skills
mkdir -p .claude/skills
cp -r /tmp/Flutter-Skills/skills/lint-and-style-config .claude/skills/lint-and-style-config
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Lint And Style Config в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Lint And Style Config, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Lint And Style Config не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Lint & Style Config

Style is not taste; it is toolchain-enforced. dart format owns whitespace, the analyzer owns correctness, and a small set of silence-producing bug classes are promoted to build-failing errors. This skill governs the analysis_options.yaml itself and the mechanics that decide whether it actually does anything. Applies whenever you edit that file, add or silence a lint, or bump the SDK/ruleset.

Read the reference for the task at hand:

  • references/rule-catalog.md — every promoted rule and its bug class, the deliberate downgrades, the contested public_member_api_docs call, and the complexity-limit table.
  • references/config-mechanics.md — the include-pin trap, errors:-re-ranks vs linter:-enables, sealed-switch analyze-vs-compile, coverage mirroring, the riverpod_lint plugin, and suppression discipline.

Copy examples/analysis_options.yaml into the package root as the starting config. Run scripts/verify-include-pin.sh and scripts/lint-gates.sh before a PR.

Non-negotiable rules

  1. dart format is the only whitespace authority. Never hand-format, never argue with it, never // dart format off except around a hand-laid table with a justifying comment. CI runs dart format --set-exit-if-changed ..
  2. Build on very_good_analysis, pinned to the version-numbered include. Never the bare analysis_options.yaml — a pub upgrade must not silently change what counts as an error. VGA already sets strict-casts, strict-inference, strict-raw-types; do not restate them in a language: block (redundant config drifts and contradicts).
  3. An info is a failure. CI runs dart analyze --fatal-infos --fatal-warnings. Unaddressed infos accumulate into noise that hides real issues.
  4. Promote only silence-producing bug classes to error — dropped Futures, swallowed failure, dead-context-after-await, resource leaks, dynamic-boundary type holes, non-exhaustive enum switches, print. Not style preferences.
  5. A promotion under errors: only works if the base ruleset already enables the rule. errors: re-ranks existing diagnostics; it cannot turn on an off rule. To enable a rule VGA omits, add it under linter: rules: first.
  6. Never mix list and map form in linter: rules:. - rule items and rule: true entries in one block is a parse error — a broken analyzer, which is a green build. To disable a base rule, use errors: <rule>: ignore.
  7. CI must build, not merely analyze. Sealed-switch exhaustiveness is a compile error, not a lint; an errors: override cannot be trusted to silence it, and any code path that reaches dart compile still fails there — an analyze-only gate can go green over code that will not build.
  8. Exclude generated code, and mirror the exact globs in coverage filtering. Otherwise generated files dilute the coverage number until it is meaningless.
  9. Suppressions are line-scoped only, with a same-line/above reason. Never // ignore_for_file: on a promoted rule; never any suppression on an architecture/import gate. Prefer fixing the code.
  10. Never add custom_lint. riverpod_lint 3.x runs on the first-party plugin system; its diagnostics fire on a plain flutter analyze.

The include, and the trap that silently disables everything

yaml
include: package:very_good_analysis/analysis_options.10.3.0.yaml

If that filename does not exist in the resolved package, you get one warning • include_file_not_found and analysis runs with zero rules. A build that checks nothing is green.

Bump the include filename in the same commit as the SDK/VGA bump, verify the file exists (ls ~/.pub-cache/hosted/pub.dev/very_good_analysis-*/lib/), and after any bump confirm a known violation still errors — never trust green. scripts/verify-include-pin.sh automates the existence check.

Promote the silence-bugs to error

yaml
analyzer:
  errors:
    unawaited_futures: error
    discarded_futures: error
    empty_catches: error
    avoid_catches_without_on_clauses: error
    only_throw_errors: error
    throw_in_finally: error
    use_build_context_synchronously: error
    cancel_subscriptions: error
    close_sinks: error            # VGA ships this at `ignore`; re-promoted
    avoid_dynamic_calls: error
    always_declare_return_types: error
    cast_nullable_to_non_nullable: error
    exhaustive_cases: error
    avoid_print: error
    avoid_slow_async_io: error

Each turns an info-level squiggle a solo dev scrolls past into a build failure. See references/rule-catalog.md for the per-rule bug class and the rules held deliberately at warning/ignore (deprecated_member_use, invalid_annotation_target, lines_longer_than_80_chars).

errors: re-ranks; linter: rules: enables

yaml
# Promoting works ONLY because VGA already enables these rules (close_sinks even
# at severity `ignore` counts as enabled — the override resurrects it).
analyzer:
  errors:
    close_sinks: error

# To enable a rule VGA does NOT ship, add it here FIRST, then optionally promote.
linter:
  rules:
    some_rule_vga_omits: true

Verify with a real violation — never assume a promotion took. The shipped config needs no linter: rules: block because every rule it promotes is VGA-enabled.

Sealed exhaustiveness is a compile error, not a lint

dart
sealed class SaveResult {}
class Saved extends SaveResult {}
class SaveFailed extends SaveResult {}

// Missing a case is `non_exhaustive_switch_statement` — a COMPILE error.
// (A switch *expression* raises `non_exhaustive_switch_expression` instead.)
String describe(SaveResult r) {
  switch (r) {
    case Saved():
      return 'saved';
    case SaveFailed():
      return 'failed';
  }
}

exhaustive_cases only covers enum / static-const sets. Model failure and mode types as sealed so a new case breaks the build at every call site instead of falling through a default into silence. An errors: override cannot be trusted to suppress an exhaustiveness diagnostic, and even where dart analyze is coaxed green dart compile still fails — so CI must build, never merely analyze. See dart3-idioms-and-coding-standards.

Excludes, mirrored to coverage

yaml
analyzer:
  exclude:
    - "**/*.g.dart"
    - "**/*.freezed.dart"
    - "**/*.drift.dart"
    - "**/generated_plugin_registrant.dart"
    - "test/drift/generated/**"   # drift schema snapshots — never reformat/fix

The identical globs must also feed coverage filtering (lcov --remove or your reporter's excludes). Excludes and coverage filters that drift apart lie the number upward. See testing-strategy and codegen-and-toolchain.

The hole no lint catches

dart
// WRONG — flagged by NOTHING. The arrow returns the Future (so discarded_futures
// is satisfied), but the target is VoidCallback, so Dart drops it silently.
onPressed: () => repository.save(note),

// RIGHT — a void-returning intent method the callback holds safely.
class NoteController {
  void saveNow(Note note) => unawaited(_repo.save(note).catchError(_report));
}
// onPressed: () => controller.saveNow(note),

The mitigation is structural, never disciplinary. A green analyzer is not proof an operation ran; the highest-severity failures are invisible to every rule and need a manual pass. See examples/callback_future_hole.dart and async-safety.

Anti-patterns

  • Bare include: package:very_good_analysis/analysis_options.yaml — a pub upgrade silently changes the ruleset; a missing pinned file silently disables it. Pin and verify.
  • Restating strict-casts/strict-raw-types in a language: block — VGA sets them; the copy drifts and eventually contradicts.
  • Promoting a rule VGA does not enable — errors: cannot resurrect an off rule, so the promotion silently does nothing.
  • Mixing - rule and rule: false in one linter: rules: block — parse error, broken analyzer, green build.
  • Analyze-only CI — passes over code that fails dart compile when a sealed switch is non-exhaustive.
  • Excludes not mirrored in coverage — generated files inflate the number.
  • // ignore_for_file: on a promoted rule, or any suppression on an import gate — the next edit is unprotected; a silenced correctness gate is a blocker.
  • Adding custom_lint — legacy plugin system; riverpod_lint 3.x needs none.
  • Reformatting a drift schema snapshot — corrupts the migration-test baseline.

Definition of done

  • dart format --set-exit-if-changed . clean; dart analyze --fatal-infos --fatal-warnings passes; CI builds (not analyze-only).
  • Include is the version-pinned VGA file and resolves in the pub cache (scripts/verify-include-pin.sh passes).
  • No redundant language: block; strict modes come from VGA.
  • The silence-bug classes are promoted to error; every promoted rule is one VGA actually enables.
  • No mixed list/map form in linter: rules:.
  • Generated-file excludes present and mirrored in coverage filtering.
  • Any suppression is line-scoped with a reason, none on an architecture gate; no // ignore_for_file: on a promoted rule.
  • riverpod_lint configured with a version: key; no custom_lint.

Related skills

  • dartdoc-conventions — backs public_member_api_docs: error and the seams to document.
  • async-safety — the Future-dropped-in-a-callback hole this config cannot see.
  • error-handling-typed-results — the sealed Failure/Result spine that makes exhaustiveness a compile-time guarantee.
  • dart3-idioms-and-coding-standards — sealed types and the exhaustive-switch discipline behind rule 7.
  • naming-conventions — the role suffixes and Effective-Dart naming the analyzer does not enforce.
  • state-management-riverpod — the Riverpod patterns riverpod_lint guards.
  • codegen-and-toolchain / run-codegen — the generated files these excludes cover.
  • ci-pipeline-and-gates — where these gates and the build-not-analyze rule run.
  • testing-strategy — coverage mirroring and what a green analyzer cannot prove.
  • dependency-hygiene — the version-pinned lint include as a dependency concern.

References

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Lint And Style Config?

Задаёт строгие правила для analysis_options.yaml на основе very_good_analysis: strict-casts/strict-raw-types, фиксированный набор классов ошибок, которые обычно остаются незамеченными, но должны считаться ошибками (unawaited_futures, discarded_futures, empty_catches, use_build_context_synchronously, cancel_subscriptions, close_sinks, avoid_dynamic_calls, exhaustive_cases, avoid_print), dart format как единственный источник правил форматирования пробелов, исключения для сгенерированных файлов, синхронизированные с coverage, и подавление предупреждений только для конкретных строк. Объясняет л...

Зачем использовать Lint And Style Config в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Lint And Style Config — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Lint And Style Config в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/zakariaf/Flutter-Skills/tree/main/skills/lint-and-style-config. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Lint And Style Config?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Lint And Style Config?

С любым количеством. В TypingMind вы можете использовать Lint And Style Config с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Lint And Style Config?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — zakariaf. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все
Логотип openclaw

Openclaw Repair Sweep

openclaw
ОрганизацияПопулярный

Проводите кампании по исправлению выбранных проблем и PR в OpenClaw: координируйте исполнителей, устанавливайте первопричины и вносите исправления или закрывайте проверенные задачи в пределах запрошенных полномочий.

82.2K
391K
Файлы: 1
Открыть
Логотип openclaw

Openclaw Test Performance

openclaw
ОрганизацияПопулярный

Сравнивайте производительность, диагностируйте проблемы и оптимизируйте время выполнения тестов OpenClaw и набора тестов плагинов, узкие места при импорте, загрузку CPU и RSS, рост кучи и медленные пути покрытия кода.

82.2K
391K
Файлы: 1
Открыть
Логотип openclaw

Openclaw Testing

openclaw
ОрганизацияПопулярный

Выбирайте подходящие по масштабу тесты и проверки OpenClaw, диагностируйте сбои и направляйте вопросы, зависящие от окружения, и подтверждение релиза ответственным за них специалистам.

82.2K
391K
Файлы: 2
Открыть
Логотип openclaw

Release Openclaw Ci

openclaw
ОрганизацияПопулярный

Запускайте и отслеживайте полный CI-процесс релиза OpenClaw, проверки релиза, контрольные проверки подключений к рабочим провайдерам, подтверждения установки и обновления, а также предварительные проверки секретов релиза; разбирайте ошибки и составляйте сводки.

82.2K
391K
Файлы: 3
Открыть

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇