Skip to content

Bug: Types are broken in 9.20.1 #19441

@Jason3S

Description

@Jason3S

The types are still broken. context.report(report); doesn't accept a ReportDescriptor.

import type { Rule } from 'eslint';

export function getReport(context: Rule.RuleContext) {
  const code = context.sourceCode;
  const report: Rule.ReportDescriptor = {
    messageId: '42',
    loc: code.getLocFromIndex(0),
  };
  context.report(report); // <--- Error
}

Originally posted by @Jason3S in #19414

See: https://stackblitz.com/edit/stackblitz-starters-m8ciayku?file=index.ts

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionbugESLint is working incorrectlytypesRelated to TypeScript types

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions