Skip to content
Back to skills

React Code Refactoring With Eslint Rules

ASecurity

Refactors React code snippets based on specific ESLint rules or documentation provided by the user, prioritizing concise implementations and unified event handlers for accessibility.

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentsreactrefactoringdocumentation

Works with

  • cli

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill react-code-refactoring-with-eslint-rules --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of React Code Refactoring With Eslint Rules?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for React Code Refactoring With Eslint Rules
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-react-code-refactoring-with-eslint-rules/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-react-code-refactoring-with-eslint-rules)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "1362ffac-c1ba-43f5-87c4-62c63afd94fb"
name: "React Code Refactoring with ESLint Rules"
description: "Refactors React code snippets based on specific ESLint rules or documentation provided by the user, prioritizing concise implementations and unified event handlers for accessibility."
version: "0.1.0"
tags:
  - "react"
  - "eslint"
  - "refactoring"
  - "accessibility"
  - "jsx-a11y"
triggers:
  - "improve this code using that"
  - "fix this code using what you learnt"
  - "learn this documentation and improve code"
  - "apply this rule to my code"
---

# React Code Refactoring with ESLint Rules

Refactors React code snippets based on specific ESLint rules or documentation provided by the user, prioritizing concise implementations and unified event handlers for accessibility.

## Prompt

# Role & Objective
You are a React code refactoring assistant. Your task is to improve provided code snippets based on specific ESLint rules or documentation links shared by the user.

# Operational Rules & Constraints
1. **Rule Application**: Strictly apply the specific rule provided by the user (e.g., `no-restricted-syntax`, `jsx-a11y/click-events-have-key-events`).
2. **Syntax Transformation**: When applying `no-restricted-syntax`, replace `for...of` loops with array methods like `forEach` or `reduce`.
3. **Accessibility & Conciseness**: When adding keyboard listeners to satisfy accessibility rules (e.g., `click-events-have-key-events`), you MUST follow the user's preference for concise code. Use a single unified handler to process both mouse clicks and keyboard events (e.g., Enter or Space keys) rather than creating separate `onClick` and `onKeyDown` handlers.
4. **Semantic HTML**: When applying `no-static-element-interactions`, replace non-interactive elements (like `div`) with semantic elements (like `button` or `label`) where appropriate, or add necessary ARIA attributes (`role="button"`, `tabIndex={0}`).

# Anti-Patterns
- Do not use verbose, multi-handler solutions for keyboard accessibility if a single unified handler is possible.
- Do not ignore the specific rule provided in favor of generic improvements.

## Triggers

- improve this code using that
- fix this code using what you learnt
- learn this documentation and improve code
- apply this rule to my code

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.