Skip to content
Back to skills

Eslint Knowledge Patch

ASecurity

ESLint

  • 25 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added September 5, 2026
developmenttypescriptgonodeexpressgitapidocumentation

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill eslint-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Eslint Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Eslint Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-eslint-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-eslint-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: eslint-knowledge-patch
description: ESLint
version: "10.0.0"
license: MIT
metadata:
  author: Nevaberry
---


# ESLint Knowledge Patch

Load this skill when migrating ESLint configuration, updating custom rules or
parsers, maintaining integrations, or adjusting rule tests and diagnostic consumers.
Use the references for detailed rule behavior, examples, and change attribution.

## Reference index

| Reference | Topics |
| --- | --- |
| [Configuration and Migration](references/configuration-and-migration.md) | Flat config, ignores, runtimes, dependencies, parser settings, configuration types, CLI failures, caching, maintenance |
| [Rules, Tests, and Integrations](references/rules-tests-and-integrations.md) | Removed APIs, rule context, source access, fixers, scope, languages, code paths, RuleTester, formatters, rule behavior, suggestions, TypeScript fixes |

## Breaking changes and deprecations

### Runtime and configuration migration

ESLint 10 requires Node.js `^20.19.0 || ^22.13.0 || >=24`.
Update CI and editor runtimes using older Node.js 20 or 22 releases, or any
Node.js 21 or 23 release. ESLint 10.5.0 documents ICU support as a Node.js prerequisite.
If TypeScript configuration loads through `jiti`, use `jiti` 2.2.0 or later.

Migrate `.eslintrc.*` and `.eslintignore` to flat config.
Replace `/* eslint-env */` comments, which now produce lint errors.
ESLint ignores `ESLINT_USE_FLAT_CONFIG` and removes these CLI flags:
`--no-eslintrc`, `--env`, `--resolve-plugins-relative-to`, `--rulesdir`, and `--ignore-path`.

Configuration lookup starts at each linted file's directory and searches upward
for `eslint.config.*`. One monorepo lint run can use multiple configuration files.
Remove `v10_config_lookup_from_file`; this lookup is now the default.

### Removed integration APIs and diagnostic fields

`loadESLint()` always returns `ESLint`.
`new Linter({ configType: "eslintrc" })` throws.
`Linter` drops `defineParser()`, `defineRule()`, `defineRules()`, and `getRules()`.
The `eslint/use-at-your-own-risk` entry point drops `LegacyESLint` and
`FileEnumerator`; its `shouldUseFlatConfig()` always returns `true`.

ESLint 10 removes `LintMessage.nodeType` and `type` from expected `RuleTester`
errors. Update lint-result consumers and test assertions that use these fields.

### Rule context and source access migration

| Removed member | Replacement |
| --- | --- |
| `context.getCwd()` | `context.cwd` |
| `context.getFilename()` | `context.filename` |
| `context.getPhysicalFilename()` | `context.physicalFilename` |
| `context.getSourceCode()` | `context.sourceCode` |
| `context.parserOptions` | `context.languageOptions` or `context.languageOptions.parserOptions` |
| `context.parserPath` | Removed without a replacement |
| `getTokenOrCommentBefore()` | `getTokenBefore()` with `{ includeComments: true }` |
| `getTokenOrCommentAfter()` | `getTokenAfter()` with `{ includeComments: true }` |
| `isSpaceBetweenTokens()` | `isSpaceBetween()` |
| `getJSDocComment()` | Removed without a replacement |

### Fixer and parser integration changes

All `RuleFixer` methods accepting text validate that it is a string.
Convert computed values to strings before passing them to a fixer.
The `Program` range includes all leading and trailing comments and whitespace;
a fix replacing the full range replaces that surrounding text too.

ESLint registers globals through `ScopeManager#addGlobals()`.
Check that a custom parser's own scope manager implements this method.

### Changed diagnostics and deprecated rule settings

The recommended preset enables additional rules; projects using it can see new diagnostics.
JSX such as `<Card />` references `Card`: `no-unused-vars` recognizes imports used
only in JSX, and `no-undef` can report a missing binding.
`no-shadow-restricted-names` reports bindings shadowing `globalThis` by default.

`no-invalid-regexp` requires unique entries in its configured flags array.
Remove duplicate entries to keep the configuration valid.
`radix` deprecates the explicit `"always"` and `"as-needed"` option values.
For `max-params`, `countThis` supersedes deprecated `countVoidThis`.
Set `countThis: "never"` to exclude any TypeScript `this` parameter from the count.

## Configuration helpers and dependency requirements

### Load ignore files into flat config

ESLint 10.4.0 exposes `includeIgnoreFile()` from `eslint/config` to load an ignore file:

```js
import { includeIgnoreFile } from "eslint/config";
import { fileURLToPath } from "node:url";

export default [includeIgnoreFile(fileURLToPath(new URL(".gitignore", import.meta.url)))];
```

### Parser precedence and rule options

If a parser setting appears in both `languageOptions` and
`languageOptions.parserOptions`, the value inside `parserOptions` takes precedence,
as clarified in the ESLint 10.5.0 documentation.
ESLint 10.15.0 recommends serializable rule options; a string identifier can be resolved
to a callback by a custom rule.

### Type definitions and dependencies

ESLint 10.8.0 exports `ConfigObject` from `eslint/config` to type flat config objects.
The ESLint 10.0.3 documentation specifies TypeScript 5.3 as the minimum supported
version for consumers of ESLint's type definitions.
Espree 11.1.0 and ESLint Scope 9.1.0 ship their own type definitions;
migrate from `@types/espree` and `@types/eslint-scope` and check for type differences.

ESLint 10.0.1 adds `eslint` as a peer dependency of `@eslint/js`. When installing both,
use an ESLint version within the preset's peer dependency range.
ESLint 10.15.0 raises its `minimatch` dependency floor to `11.0.1`;
update any override pinning ESLint's copy below that version.

## Custom rules and stronger assertions

### Declare supported languages and dialects

Custom rules can declare supported languages through `meta.languages` in ESLint 10.2.0,
using the same identifiers flat config selects with `language`, such as `json/json`.
Use `meta.docs.dialects`, documented as of ESLint 10.2.1, to document supported dialects.
ESLint 10.4.1 adds `CodePath` and `CodePathSegment` definitions for TypeScript consumers
of the code-path API. ESLint 10.2.1 models generator resumption after `yield`.

### Read tokens and comments

ESLint 10.12.0 accepts tokens and comments as the first argument to `SourceCode#getText()`.
For example, `context.sourceCode.getText(comment)` returns comment text with delimiters.

### Require complete RuleTester expectations

Pass `assertionOptions` alongside `valid` and `invalid` in the third argument
to `RuleTester#run()`.

- `requireMessage: true` requires each expected error to specify `message` or `messageId`.
- `requireMessage: "message"` or `"messageId"` requires the specified property.
- `requireLocation: true` requires `line` and `column`, plus end coordinates when the report provides them.
- `requireData: true` requires `data` for a `messageId` whose template has placeholders.

```js
ruleTester.run("no-identifiers", rule, {
  valid: ["42"],
  invalid: [{
    code: "foo",
    errors: [{
      messageId: "forbidden", data: { name: "foo" },
      line: 1, column: 1, endLine: 1, endColumn: 4
    }]
  }],
  assertionOptions: { requireMessage: "messageId", requireLocation: true, requireData: true }
});
```

In ESLint 10.5.0, `no-with` points to the `with` keyword,
`max-depth` reports on keywords, and `max-lines-per-function`,
`max-nested-callbacks`, and `max-statements` report at the function header.
In ESLint 10.15.0, `default-case` points a missing-default diagnostic at the `switch` header.
These locations affect assertions and consumers that use diagnostic locations.

## Integration and execution quick reference

### Node.js API and formatter support

ESLint 10.1.0 exposes bulk suppressions through its Node.js API.
ESLint 10.16.0 exposes `ESLint.CalculatedConfig` for the configuration returned by
`ESLint#calculateConfigForFile()`.

Custom formatters read `context.color` from the second argument to
`format(results, context)`: `--color` sets it to `true`; `--no-color` sets it to `false`.
`TimePass.parse` is optional. Timing-statistics consumers should handle passes
with no parse timing.

### CLI failures and cross-file caching

ESLint 10.4.1 propagates delegated CLI command failures through its exit status.
With `--cache`, a dependency change can leave stale lint results for an unchanged
file. Omit `--cache` when fresh results from cross-file rules are needed.

## Rule options and suggestions

| Rule | Supported behavior |
| --- | --- |
| `preserve-caught-error` | ESLint 10.7.0 adds `errorClassNames` to configure constructor names checked when a catch block throws an error without preserving the caught value as its `cause` |
| `no-constant-binary-expression` | ESLint 10.6.0 adds `checkRelationalComparisons` for constant-result checks on relational comparisons; analysis also recognizes `Symbol()` and `BigInt()` |
| `max-nested-callbacks` | ESLint 10.7.0 adds an option controlling whether callbacks passed to constructors count toward the nesting limit |
| `no-var` | ESLint 10.1.0 can autofix `var` declarations in TypeScript module and namespace blocks; withholds the fix if code uses the variable before its declaration |
| `no-useless-rename` | ESLint 10.15.0 preserves the inline `type` modifier when removing a redundant import alias |
| `prefer-arrow-callback` | ESLint 10.15.0 preserves TypeScript type parameters when converting generic function expressions to arrow functions |
| `eqeqeq` | ESLint 10.16.0 can suggest `value === null || value === undefined` for `value == null` |
| `no-eq-null` | ESLint 10.16.0 offers editor suggestions for reported loose comparisons with `null` |
| `no-new-native-nonconstructor` | ESLint 10.16.0 offers editor suggestions for reports such as `new Symbol()` |

See the rules reference for object-property semantics, capitalization, TypeScript
bindings, control-flow checks, additional suggestions, and statement-boundary preservation.

Files in this skill

  • SKILL.md8.5 KB
  • coverage.json519 B
  • references/configuration-and-migration.md3.6 KB
  • references/rules-tests-and-integrations.md5.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.