1---2name: dotnet-eslint3description: Use ESLint in .NET repositories that ship JavaScript, TypeScript, React, or other Node-based frontend assets. Use when a repo needs a configurable CLI lint gate for frontend correctness, import hygiene, unsafe patterns, or framework-specific rules.4---56# ESLint for Frontend Assets in .NET Repositories78## Trigger On910- the repo has `package.json`, `eslint.config.*`, `.eslintrc*`, `tsconfig.json`, or JS/TS/React frontend files11- the user asks for JavaScript or TypeScript linting, React rule enforcement, import hygiene, or unsafe frontend patterns12- CI should fail on frontend lint findings instead of relying on editor-only feedback1314## Do Not Use For1516- CSS ownership by itself; route that to `dotnet-stylelint`17- HTML-only checks on static output; route that to `dotnet-htmlhint`18- repos that intentionally standardized on Biome as the only JS or TS formatter-linter, unless migration or comparison is explicitly requested1920## Inputs2122- the nearest `AGENTS.md`23- `package.json`24- `eslint.config.*` or `.eslintrc*`25- `tsconfig.json` when TypeScript or type-aware rules are involved2627## Workflow28291. Detect ownership first:30 - existing ESLint config31 - package manager and workspace layout32 - framework packages such as React, Next.js, Vue, or plain TypeScript332. Keep ESLint as the semantic lint owner for JS and TS files when the repo needs rich plugin ecosystems or framework-specific rules.343. Prefer checked-in local devDependencies over global installs so CI and local runs match.354. Add narrow scripts to `package.json`, for example:36 - `lint`: `eslint .`37 - `lint:fix`: `eslint . --fix`385. Scope auto-fix runs before broad rewrites:39 - fix a bounded folder or glob first40 - rerun the linter41 - rerun the frontend build or tests if the repo has them426. If the repo wants type-aware rules, verify the target files are covered by the intended `tsconfig.json` before enabling heavier rules.437. Do not hide noise by mass-disabling rules. Fix code, narrow scope, or phase severity deliberately.4445## Bootstrap When Missing46471. Detect current state:48 - `rg --files -g 'package.json' -g 'eslint.config.*' -g '.eslintrc*' -g 'tsconfig.json'`49 - `rg -n '"eslint"|"@typescript-eslint"|"eslint-plugin-" --glob 'package.json' .`502. Prefer a repo-local install:51 - `npm install --save-dev eslint`523. Add framework-specific plugins only when the repo actually uses the framework.534. Create or refine `eslint.config.js` or `eslint.config.mjs` instead of leaving setup implicit.545. Add repeatable commands to `AGENTS.md` and `package.json`, then verify with:55 - `npx eslint .`56 - `npx eslint . --fix`576. Return `status: configured` if the repo now has a working lint gate, or `status: improved` if existing setup was tightened.587. Return `status: not_applicable` only when another documented tool already owns JS or TS linting and migration is not requested.5960## Handle Failures6162- Parsing errors on TS or JSX usually mean the config or parser stack does not match the file set; verify framework plugins and `tsconfig.json` coverage first.63- `Definition for rule ... was not found` usually means a missing plugin package or a config targeting a different ESLint major version.64- `File ignored because of a matching ignore pattern` usually means the glob is too broad or ignores were left stale after a folder move.65- Huge warning floods should be handled in phases with bounded globs, not by downgrading everything to `off`.6667## Deliver6869- explicit ESLint ownership for JS or TS frontend assets70- checked-in commands for `lint` and `lint:fix`71- config decisions that match the repo's real frontend stack7273## Validate7475- ESLint is running from repo-local dependencies76- rule ownership is not ambiguous versus Biome or other linters77- the chosen globs match the real frontend folders78- fixes were verified with the repo's normal frontend build or test pass when available7980## Ralph Loop81821. Plan: analyze current state, target outcome, constraints, and risks.832. Execute one step and produce a concrete delta.843. Review the result and capture findings.854. Apply fixes in small batches and rerun checks.865. Update the plan after each iteration.876. Repeat until outcomes are acceptable.887. If a dependency is missing, bootstrap it or return `status: not_applicable` with a reason.8990### Required Result Format9192- `status`: `complete` | `clean` | `improved` | `configured` | `not_applicable` | `blocked`93- `plan`: concise plan and current step94- `actions_taken`: concrete changes made95- `verification`: commands, checks, or review evidence96- `remaining`: unresolved items or `none`9798## Example Requests99100- "Add ESLint to the React frontend in this ASP.NET Core repo."101- "Make JS and TS lint failures block CI."102- "Fix the current ESLint warnings without hiding them."