-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Issue Summary: eslint-plugin-todo-plz incompatible with ESLint v10
Rule affected: todo-plz/ticket-ref
ESLint version: 10.x
Problem:
The ticket-ref rule calls context.getSourceCode() in its create function:
const sourceCode = context.getSourceCode();
context.getSourceCode() was deprecated in ESLint v8 (in favor of context.sourceCode) and fully removed in ESLint v10. This causes a runtime crash when the rule is loaded:
TypeError: Error while loading rule 'todo-plz/ticket-ref': context.getSourceCode is not a function
File: lib/rules/ticket-ref.js, line 56
Fix:
Replace:
const sourceCode = context.getSourceCode();
With:
const sourceCode = context.sourceCode;
Or for backwards compatibility with ESLint v8:
const sourceCode = context.sourceCode ?? context.getSourceCode();
- ESLint v10 migration guide — removed context.getSourceCode()
- The replacement context.sourceCode has been available since ESLint v8.39.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels