Към всички skills

you-might-not-need-an-effect

ryoppippi · Разработка

Review React code for unnecessary useEffect usage based on react.dev guidelines. Analyses code for useEffect anti-patterns and optionally applies fixes. Use when reviewing React code quality or refactoring effects.

Оригинален текст · няма потвърден превод на български

Първо прочетете инструкцията.

Файлът се зарежда от посочения източник само по ваше действие. Можете да го прочетете тук, да го копирате или да го запазите като .md.

Оригинален SKILL.md
GitHub хранилище
Звезди на репото
196
Лиценз
Не е посочен. Проверете в репозитория.
Последна проверка на записа
Няма посочена дата

Добавете в своя инструмент.

Командата отваря избора на skills от репозитория. Прочетете файла и условията на автора преди изпълнение.

npx skills add ryoppippi/dotfiles

Страницата копира текст. Не инсталира и не изпълнява нищо на устройството ви.

Откъс от SKILL.md

Началото на файла на автора, без превод.

Arguments:

  • scope: what to analyze (default: your current changes). Examples: "diff to main", "PR #123", "src/components/", "whole codebase"
  • fix: whether to apply fixes (default: true). Set to false to only propose changes.

Steps:

  1. https://markdown.new/https://react.dev/learn/you-might-not-need-an-effect If inaccessible: https://react.dev/learn/you-might-not-need-an-effect
  2. Analyze the specified scope for useEffect anti-patterns
  3. If fix=true, apply the fixes. If fix=false, propose the fixes without applying.
  4. If you REALLY REALLY need to use useEffect, add a comment in the code explaining why it's necessary and link to the relevant section of the guidelines.
  5. Remember, useEffect is a escape hatch. If you cannot find alternative solutions, it's a kind of your loser's choice. But always try to find alternatives first before resorting to useEffect.

Целият SKILL.md в GitHub