home / skills / openclaw / skills / eslint-gen

eslint-gen skill

/skills/lxgicstudios/eslint-gen

This skill generates an ESLint config by analyzing your codebase patterns, enabling zero-config setup and aligned linting across frameworks.

npx playbooks add skill openclaw/skills --skill eslint-gen

Review the files below or copy the command above to add this skill to your agents.

Files (12)
SKILL.md
2.2 KB
---
name: eslint-gen
description: Generate ESLint config from your codebase patterns. Use when setting up linting.
---

# ESLint Config Generator

Stop copying ESLint configs from other projects. This tool scans your actual codebase and generates a config that matches how you already write code.

**One command. Zero config. Just works.**

## Quick Start

```bash
npx ai-eslint-config .
```

## What It Does

- Scans your existing code to detect patterns and conventions
- Generates .eslintrc that matches your actual style
- Handles TypeScript, React, Vue, and Node.js projects
- Sets up proper parser and plugin configurations
- Avoids rules that would flag your existing code

## Usage Examples

```bash
# Analyze and generate for current project
npx ai-eslint-config .

# Generate strict config
npx ai-eslint-config . --strict

# Output to specific file
npx ai-eslint-config . -o .eslintrc.json
```

## Best Practices

- **Run on clean code first** - Generate config after your codebase is in a good state
- **Review the rules** - AI picks sensible defaults but you know your team's preferences
- **Extend don't override** - Use extends for shared configs, customize only what you need
- **Add incrementally** - Start lenient, tighten rules over time

## When to Use This

- Starting a new project and need linting fast
- Standardizing code style across a team
- Migrating from TSLint or other deprecated linters
- Learning ESLint rules through real examples

## Part of the LXGIC Dev Toolkit

This is one of 110+ free developer tools built by LXGIC Studios. No paywalls, no sign-ups, no API keys on free tiers. Just tools that work.

**Find more:**
- GitHub: https://github.com/LXGIC-Studios
- Twitter: https://x.com/lxgicstudios
- Substack: https://lxgicstudios.substack.com
- Website: https://lxgic.dev

## Requirements

No install needed. Just run with npx. Node.js 18+ recommended.

```bash
npx ai-eslint-config --help
```

## How It Works

The tool uses glob patterns to find source files, analyzes code style patterns like semicolons, quotes, and spacing, then generates an ESLint config that codifies those patterns into enforceable rules.

## License

MIT. Free forever. Use it however you want.

Overview

This skill generates an ESLint configuration by analyzing your actual codebase patterns. It scans source files and produces a .eslintrc that matches how your team already writes code, including TypeScript, React, Vue, and Node.js projects. Run it with a single command—no upfront config required.

How this skill works

The tool globs your project files, inspects stylistic and structural patterns (quotes, semicolons, spacing, module style, JSX/TSX usage), and maps those patterns to ESLint rules and parser/plugin settings. It writes a ready-to-use ESLint config that avoids rules that would immediately flag existing code and can output to a file you specify. Optional flags allow stricter enforcement or custom output paths.

When to use it

  • When starting a new project and you want linting aligned with your current code
  • When standardizing code style across a team without manual rule selection
  • When migrating from TSLint or another linter and need automated mapping
  • When you want an ESLint baseline that won’t break your existing code
  • When adding linting incrementally and preferring conservative defaults

Best practices

  • Run on a reasonably clean codebase so detected patterns reflect intended style
  • Review generated rules and adjust team preferences before enforcing CI checks
  • Use generated config as a base and extend shared configs rather than replacing them
  • Start with lenient or auto-detected rules and tighten enforcement over time
  • Specify an output file to keep the generated config under version control

Example use cases

  • Quickly add ESLint to a legacy codebase without hand-picking dozens of rules
  • Create a team-consistent ESLint setup for a multi-repo migration
  • Generate a TypeScript + React config that sets appropriate parser and plugin options
  • Produce a configuration file for CI that won’t fail on the first lint run
  • Convert TSLint settings by analyzing code patterns and producing ESLint equivalents

FAQ

Does it support TypeScript and frameworks like React or Vue?

Yes. It detects TypeScript, React, Vue, and Node.js patterns and configures parser and plugins accordingly.

Will the generated config flag a lot of existing issues?

No. The generator avoids rules that contradict your existing code patterns by default, and you can choose a stricter mode if you want to adopt tighter rules.