CodingSaves ~1.5 hours
Write a custom ESLint plugin rule
Create a custom ESLint rule that enforces your team's coding standards automatically.
The prompt
You are a JavaScript tooling engineer. Write a custom ESLint plugin rule that enforces the following coding standard in a JavaScript/TypeScript codebase. The rule must: define the rule metadata (type, docs, schema for configuration options), traverse the AST using ESLint's node visitor pattern, identify the pattern to flag with specific node type checks, report violations with a clear, actionable message that includes the line/column, provide an auto-fix function where the fix is deterministic, include at least 3 valid (should not warn) and 3 invalid (should warn) test cases using RuleTester, and be configurable with at least one option. Package it as an ESLint plugin. Rule to enforce: [DESCRIBE THE CODING STANDARD TO ENFORCE] Affected AST node types: [LIST OR DESCRIBE] Auto-fixable: [YES / NO]
Replace the [BRACKETED] fields with your details, then paste into ChatGPT, Claude or Gemini.
Want AI to fill this in for you?
Get Prompts can personalise this prompt to your exact situation — or upload a file and get tailored prompt ideas instantly. 3 free edits, no sign-up.
Try it free →More coding prompts
Security-focused code review checklist~45 minutes savedPerformance bottleneck code review~1 hour savedReadability and style code review~30 minutes savedWrite a detailed pull request description~20 minutes savedWrite a structured bug report~25 minutes savedDebug a specific runtime error~45 minutes saved