$ recombobulate _
home / tips / ask-claude-to-write-a-custom-eslint-rule
0

Ask Claude to Write a Custom ESLint Rule

bagwaa @bagwaa · Mar 26, 2026 · Workflows
ask-claude-to-write-a-custom-eslint-rule

The ESLint plugin ecosystem is huge but it never has the exact rule your team needs. Claude knows the AST visitor API and can write a working custom rule from a plain-English description.

Write a custom ESLint rule called no-hardcoded-urls that reports an error 
when a string literal starts with "https://" or "http://" and isn't 
assigned to a constant named with ALL_CAPS.

Claude generates the rule file, the correct visitor structure (Literal node visitor), and a full test file using RuleTester with passing and failing cases. You don't need to know anything about AST node types.

Write an ESLint rule called require-error-boundary-in-async-components that 
warns when a React component uses useQuery or useSWR but doesn't have an 
ErrorBoundary wrapper in its nearest parent component tree.

For enforcement in your codebase, Claude will also show you how to wire the rule into your eslint.config.js:

// Claude will generate this setup
import noHardcodedUrls from './eslint-rules/no-hardcoded-urls.js'

export default [
  {
    plugins: { local: { rules: { 'no-hardcoded-urls': noHardcodedUrls } } },
    rules: { 'local/no-hardcoded-urls': 'error' }
  }
]

If you can describe the bad pattern, Claude can write the rule that catches it.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Scan Pending Changes for Security Issues with /security-review

The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.

bagwaa @bagwaa · 2 hours ago
0
Run Setup Scripts on Every Session with the SessionStart Hook

The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.

bagwaa @bagwaa · 2 hours ago
0
Write Property-Based Tests with fast-check and Claude

Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.

bagwaa @bagwaa · 2 hours ago