Skip to content
Skills Library
Programming · Automation

eslint

/eslint

Expert ESLint assistance covering Flat Config (eslint.config.js), typescript-eslint, custom rules, and automated formatting. Use when enforcing code quality and preventing bugs in JavaScript/TypeScript.

Licence
MIT
Last repository change
01.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 01.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Expert ESLint assistance covering Flat Config (eslint.config.js), typescript-eslint, custom rules, and automated formatting. Use when enforcing code quality and preventing bugs in JavaScript/TypeScript.

Original author description

Expert ESLint assistance covering Flat Config (eslint.config.js), typescript-eslint, custom rules, and automated formatting. Use when enforcing code quality and preventing bugs in JavaScript/TypeScript.

How it works

  1. When to Use
  2. Quick Start
  3. Core Concepts
  4. Common Patterns
  5. Best Practices
  6. Troubleshooting
  7. References
Original SKILL.md headings · 188 lines, 609 words
SKILL.md preview
---
name: eslint
description: Expert ESLint assistance covering Flat Config (eslint.config.js), typescript-eslint, custom rules, and automated formatting. Use when enforcing code quality and preventing bugs in JavaScript/TypeScript.
---

# ESLint

ESLint is the industry-standard static analysis tool for identifying and fixing problems in JavaScript and TypeScript codebases, configured via modern Flat Config (`eslint.config.js`).

## When to Use

- **Static Code Analysis for JavaScript/TypeScript**: Catching bugs, anti-patterns, and syntax errors before code review.
- **Modern ESLint Flat Config (eslint.config.js)**: Unified, composable configuration format in ESLint v9+.
- **Enforcing TypeScript Best Practices**: Integrating `@typescript-eslint` with type-aware lint rules.
- **Team Code Standardization**: Automating rule compliance across React, Next.js, Vue, and Node.js codebases.

## Quick Start

```javascript
// eslint.config.mjs (Modern Flat Config)
import js from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
  js.configs.recommended,
  ...tseslint.configs.recommended,
  {
    rules: {
      "no-console": "warn",
      "@typescript-eslint/no-unused-vars": [
        "error",
        { argsIgnorePattern: "^_" },
      ],
    },
  },
);
```

## Core Concepts

### Modern Flat Config Architecture (eslint.config.js)

Configuring ESLint v9+ with TypeScript and React:

```javascript
// eslint.config.js
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";

export default tseslint.config(
  // Global ignore rules
  { ignores: ["dist/", "build/", "node_modules/", ".next/"] },

  // Base recommended JavaScript rules
  js.configs.recommended,

  // TypeScript recommended with type-checking rules
  ...tseslint.configs.recommendedTypeChecked,
  {
    languageOptions: {
      parserOptions: {
        project: "./tsconfig.json",
        tsconfigRootDir: import.meta.dirname,
      },
    },
  },

  // React and Hooks rules
  {
    files: ["**/*.{tsx,jsx}"],
    plugins: {
      react: reactPlugin,
      "react-hooks": reactHooksPlugin,
    },
    rules: {
      ...reactHooksPlugin.configs.recommended.rules,
      "react/react-in-jsx-scope": "off", // Not needed in React 17+
      "@typescript-eslint/no-explicit-any": "error",
      "@typescript-eslint/no-unused-vars": [
        "error",
        { argsIgnorePattern: "^_" },
      ],
      "no-console": ["warn", { allow: ["warn", "error"] }],
    },
  },
);
```

### Authoring a Custom Lint Rule

Creating a custom organizational lint rule:

```javascript
// rules/no-hardcoded-api-urls.js
export default {
  meta: {
    type: "problem",
    docs: {
      description: "Disallow hardcoded internal API URLs in client code",
    },
    messages: {
      noHardcodedUrl:
        "Hardcoded API URL detected. Use environment variables instead.",
    },
  },
  create(context) {
    return {
      Literal(node) {
        if (
          typeof node.value === "string" &&
          node.value.includes("api.internal.company.com")
        ) {
          context.report({ node, messageId: "noHardcodedUrl" });
        }
      },
    };
  },
};
```

### Executing ESLint via CLI

Running analysis and automated fixes:

```bash
# Lint entire repository
npx eslint .

# Automatically fix autofixable problems
npx eslint . --fix

# Lint with caching to speed up recurring runs
npx eslint . --cache --cache-location .eslintcache
```

## Common Patterns

### Strict React Hooks and Accessibility Guardrails

**Problem**: Silent memory leaks and unhandled dependency arrays in React components.

**Solution**:
Configure React and Hooks plugins in Flat Config:

```javascript
import reactHooks from "eslint-plugin-react-hooks";
import jsxA11y from "eslint-plugin-jsx-a11y";

export default [
  {
    plugins: {
      "react-hooks": reactHooks,
      "jsx-a11y": jsxA11y,
    },
    rules: {
      ...reactHooks.configs.recommended.rules,
      "react-hooks/exhaustive-deps": "error",
      "jsx-a11y/alt-text": "error",
    },
  },
];
```

## Best Practices

**Do**:

- Migrate to ESLint Flat Config (`eslint.config.js` / `eslint.config.mjs`); legacy `.eslintrc.*` is deprecated in ESLint v9+.
- Enable `recommendedTypeChecked` from `typescript-eslint` for deep semantic type validation.
- Use `--cache` in CI and local scripts to only lint modified files.
- Ignore files via the top-level `{ ignores: [...] }` object in `eslint.config.js`.

**Don't**:

- Use ESLint for code formatting (indentation, semicolons); delegate formatting to Biome or Prettier.
- Disable rules globally with inline comments (`/* eslint-disable */`); disable specifically with rationale.
- Enable type-aware rules without supplying `parserOptions.project`; it causes parser errors.

## Troubleshooting

| Error                                               | Cause                                                                                    | Solution                                                        |
| :-------------------------------------------------- | :--------------------------------------------------------------------------------------- | :-------------------------------------------------------------- |
| `ESLint couldn't find a configuration file`         | Project running ESLint v9+ without `eslint.config.js` or `ESLINT_USE_FLAT_CONFIG=false`. | Migrate to Flat Config (`eslint.config.js`) or set legacy flag. |
| `Parsing error: Cannot read file .../tsconfig.json` | `parserOptions.project` path incorrectly configured.                                     | Verify `tsconfig.json` path in `typescript-eslint` config.      |
| `Definition for rule '...' was not found`           | Plugin imported but missing in `plugins:` object.                                        | Declare plugin name in config `plugins` map.                    |

## References

- [ESLint Documentation](https://eslint.org/)

Versions

RepositoryScoreLicence
This page · G1Joshi/Agent-Skills100MIT
TerminalSkills/skills100Apache-2.0
managedcode/dotnet-skills100MIT
claude-dev-suite/claude-dev-suite100MIT
el-feo/ai-context100MIT

Database snapshot: 13.11.2026 · package version d4fdbcdd20e7 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100typescript-eslint
    typescript-eslint - ESLint plugin for TypeScript USE WHEN: user mentions "typescript-eslint", "TypeScript linting", "type-aware rules", asks about "no-floating-promises", "TypeScript ESLint config", "@typescript-eslint rules" DO NOT USE FOR: ESLint 9 full setup - use…
  • 100eslint-checker
    Run ESLint for JavaScript/TypeScript code quality and style enforcement. Use for static analysis and auto-fixing.
  • 100eslint-biome
    ESLint 9 flat config and Biome linter configuration. Covers typescript-eslint, rule categories, migration from legacy config, and performance optimization. USE WHEN: user mentions "ESLint 9", "Biome", "flat config", "eslint.config.mjs", asks about "typescript-eslint", "migration…
  • 100ts-lint-format
    Use when choosing or configuring a TS linter/formatter — Biome 2.x vs ESLint 10 flat config + typescript-eslint typed linting. Not for type checking itself (ts-config).
  • 100linting-neostandard-eslint9
    Configures ESLint v9 flat config and neostandard for JavaScript and TypeScript projects, including migrating from legacy `.eslintrc*` files or the `standard` package. Use when you need to set up or fix linting with `eslint.config.js` or `eslint.config.mjs`, troubleshoot lint…
  • 95typescript-quality-checker
    Validate TypeScript/JavaScript code quality with ESLint, Prettier, type checking, and security analysis. Use for TypeScript/JS codebases to ensure code quality and standards.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.