eslint-optimizer

Configures ESLint flat config for Next.js, React, and TypeScript projects with tuned rule severity.

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/DingJun1028/esggo-kv --skill eslint-optimizer-dingjun1028
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: eslint-optimizer
Source: https://github.com/DingJun1028/esggo-kv/tree/main/.agents/skills/eslint-optimizer
Command: npx skills add https://github.com/DingJun1028/esggo-kv --skill eslint-optimizer-dingjun1028

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up ESLint for a Next.js/React/TypeScript codebase often produces hundreds of errors from overly strict rules, blocking CI and forcing teams to choose between disabling linting entirely or drowning in false positives. ## Core Features & Use Cases - Ready-to-use flat config template: A complete eslint.config.js combining typescript-eslint, react, react-hooks, jsx-a11y, import, and @next/next plugins with sensible defaults. - Rule severity tuning guidance: Explains which rules to downgrade to warn (e.g., no-explicit-any) and which to disable (e.g., react-hooks/set-state-in-effect) with documented rationale. - Common pitfall fixes: Covers flat-config glob issues like using **/*.cjs instead of *.cjs to match files in subdirectories. - Use Case: You inherit a large Next.js monorepo where pnpm lint fails with 500 errors. Apply this config template to get CI passing immediately while tracking real issues as warnings. ## Quick Start Ask the AI to set up an optimized ESLint flat config for my Next.js TypeScript project that passes CI without disabling important rules.

Frequently Asked Questions about eslint-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure ESLint flat config for a Next.js TypeScript project?▼

Create an eslint.config.js that spreads typescript-eslint recommended configs, registers react, react-hooks, jsx-a11y, import, and @next/next plugins, and sets the TypeScript parser with browser and node globals. Merge each plugin's recommended rules, then override noisy ones.

How to reduce ESLint errors in a large existing codebase?▼

Downgrade high-volume rules like @typescript-eslint/no-explicit-any and no-unused-vars from error to warn so CI passes while technical debt stays visible. Only disable rules that flag valid patterns, and avoid per-file suppressions in favor of project-wide config.

Why does ESLint flat config ignore *.cjs files in subdirectories?▼

In flat config, the pattern *.cjs only matches root-level files. Use **/*.cjs in the ignores array to match CommonJS files in subdirectories such as scripts/gen-gallery-index.cjs.

Should I disable react-hooks/set-state-in-effect in ESLint?▼

Yes, if your code fetches data in useEffect and calls setState inside the fetch callback, which is the standard React data-fetching pattern. This React Compiler rule produces false positives for that pattern, so disabling it avoids noise.

When should an ESLint rule be a warning instead of an error?▼

Use warn when a rule flags patterns that are impractical to fix across a large codebase in one change, such as no-explicit-any or no-require-imports. This keeps CI green while preserving visibility of technical debt for gradual cleanup.