Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Eslint Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-eslint-knowledge-patch)
---
name: eslint-knowledge-patch
description: ESLint
version: "10.0.0"
license: MIT
metadata:
author: Nevaberry
---
# ESLint compatibility and migration
Load this skill when migrating ESLint configuration, updating custom rules or
parsers, maintaining lint integrations, or investigating changes to core-rule
diagnostics, suggestions, and fixes.
| Reference | Topics |
| --- | --- |
| [Configuration and Migration](references/configuration-and-migration.md) | Flat config migration and lookup, runtimes, dependency requirements, config helpers and types, rule settings, CLI failures, caching, bulk suppressions |
| [Rules, Tests, and Integrations](references/rules-tests-and-integrations.md) | Removed APIs, rule metadata, parser scopes, source text, code paths, RuleTester, result consumers, diagnostics, TypeScript support, suggestions and fixes |
## Migrate legacy configuration and CLI usage
ESLint 10 removes legacy configuration. Migrate `.eslintrc.*` and `.eslintignore`
to flat config and replace `/* eslint-env */` comments, which now produce lint
errors. ESLint ignores `ESLINT_USE_FLAT_CONFIG`.
The removed CLI flags are `--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.*`. A single monorepo lint run can use multiple configuration
files. Remove `v10_config_lookup_from_file`; this lookup is now the default.
## Update runtime and dependency requirements
- ESLint 10 requires Node.js `^20.19.0 || ^22.13.0 || >=24`. Update CI and editor
runtimes using older releases in the Node.js 20 or 22 lines, or any Node.js 21
or 23 release.
- If ESLint loads TypeScript configuration through `jiti`, use 2.2.0 or later.
- ESLint 10.5.0 documents ICU support as a Node.js prerequisite. Use a Node.js
build with ICU enabled when selecting a custom runtime for ESLint.
- The ESLint 10.0.3 documentation specifies TypeScript 5.3 as the minimum for
consumers of ESLint's type definitions.
- ESLint 10.0.1 adds `eslint` as a peer dependency of `@eslint/js`. When installing
both packages, use an ESLint version within the preset's peer dependency range.
- ESLint 10.14.0 raises its `minimatch` floor to `10.2.6` for the brace-expansion
security fix; ESLint 10.15.0 raises the floor to `11.0.1`. Update overrides that
pin ESLint's copy below the applicable floor.
## Replace removed APIs and diagnostic fields
In ESLint 10, `loadESLint()` always returns `ESLint`, and
`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`.
| Removed rule context 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` | No replacement |
For `SourceCode`, replace `getTokenOrCommentBefore()` and
`getTokenOrCommentAfter()` with `getTokenBefore()` and `getTokenAfter()` using
`{ includeComments: true }`. Replace `isSpaceBetweenTokens()` with
`isSpaceBetween()`. `getJSDocComment()` is removed without a replacement.
Update consumers that read `LintMessage.nodeType` and remove `type` from expected
`RuleTester` errors; ESLint 10 removes both fields.
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
spans the entire source, including leading and trailing comments and whitespace;
a fix replacing that range replaces those characters too.
## Resolve deprecations and rule configuration changes
The `radix` rule deprecates its explicit `"always"` and `"as-needed"` option values.
The `no-invalid-regexp` option schema requires unique entries in the configured
flags array; remove duplicates to keep configuration valid.
For `max-params`, `countThis` supersedes deprecated `countVoidThis`.
Set `countThis: "never"` to exclude any TypeScript `this` parameter:
```js
export default [{ rules: { "max-params": ["error", { max: 2, countThis: "never" }] } }];
```
The recommended preset enables additional rules, so projects using it can see
new diagnostics after upgrading.
## Use flat config helpers and types
ESLint 10.4.0 exposes `includeIgnoreFile()` from `eslint/config` to load an ignore
file into flat config:
```js
import { includeIgnoreFile } from "eslint/config";
import { fileURLToPath } from "node:url";
export default [includeIgnoreFile(fileURLToPath(new URL(".gitignore", import.meta.url)))];
```
ESLint 10.8.0 exports `ConfigObject` from `eslint/config` for typing flat config
objects. ESLint 10.16.0 exposes `ESLint.CalculatedConfig` for the configuration
returned by `ESLint#calculateConfigForFile()`.
When a parser setting appears in both `languageOptions` and
`languageOptions.parserOptions`, the value inside `parserOptions` takes
precedence. ESLint 10.5.0 clarifies this in the configuration documentation.
The ESLint 10.15.0 documentation recommends serializable values in rule options;
for example, pass a string identifier that a custom rule can resolve to a callback.
## Strengthen RuleTester assertions
Pass `assertionOptions` alongside `valid` and `invalid` in the third argument to
`RuleTester#run()`:
- `requireMessage: true` requires every expected error to specify `message` or
`messageId`. The values `"message"` and `"messageId"` require that 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 }
});
```
## Update custom rules and parser integrations
Custom rules can declare supported languages through `meta.languages`. Use the
same identifiers selected by flat config's `language`, such as `json/json`.
Use `meta.docs.dialects` to document supported dialects; ESLint documents this
field as of 10.2.1.
ESLint uses `ScopeManager#addGlobals()` to register globals. If a custom parser
supplies its own scope manager, check that it implements the method.
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 in integrations.
ESLint 10.4.1 adds the missing `CodePath` and `CodePathSegment` types. ESLint
10.2.1 models paths where a generator resumes after `yield`; custom rules using
code-path events can observe this flow.
ESLint 10.12.0 accepts tokens and comments as the first argument to
`SourceCode#getText()`. For example, `context.sourceCode.getText(comment)` returns
the comment text with its delimiters.
## Account for changed diagnostics and fixes
Using `<Card />` counts as a reference to `Card`: `no-unused-vars` recognizes an
import used only in JSX, and `no-undef` can report a missing binding.
`no-shadow-restricted-names` reports bindings shadowing `globalThis` by default.
ES2026 globals include `Temporal`; `Temporal()` produces a diagnostic with
`no-obj-calls` enabled. ESLint 10.13.0 also adds `globalThis` to that rule's checked
built-in objects, so `globalThis()` produces a diagnostic when the rule is enabled.
In ESLint 10.1.0, `no-var` can autofix `var` inside TypeScript module and namespace blocks
(`TSModuleBlock` nodes). The rule withholds the fix when code uses the variable
before its declaration.
ESLint 10.8.1 accounts for automatic semicolon insertion in the `no-unused-labels`
autofix and the `removeVar` suggestion from `no-unused-vars`, preserving statement
boundaries when code is removed.
ESLint 10.15.0 preserves inline `type` modifiers in `no-useless-rename` import
autofixes and TypeScript type parameters in `prefer-arrow-callback` autofixes.
See [Rules, Tests, and Integrations](references/rules-tests-and-integrations.md)
for diagnostic location changes, additional rule checks, and editor suggestions.
## Consume CLI and integration results
ESLint 10.1.0 exposes bulk suppressions through its Node.js API. ESLint 10.4.1
propagates delegated CLI command failures through ESLint's 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.
For custom formatters, read `context.color` from the second argument to
`format(results, context)`: ESLint sets it to `true` for `--color` and `false` for
`--no-color`.
The `TimePass` type makes `parse` optional. Consumers of timing statistics should
handle passes with no parse timing.