8000 Accept `readonly RuleFix[]` on `context.report({ fix })` · Issue #3829 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content
Accept readonly RuleFix[] on context.report({ fix }) #3829
Closed
@rafaelss95

Description

@rafaelss95
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

context.report({
  fix(fixer) {
    const fixes = [...] as const;
    return fixes;
  }
});

Expected Result
No errors :).

Actual Result
readonly not allowed

Additional Info
A readonly [] is already accepted for suggestions. Probably doing this change would be sufficient (I can take this if accepted):

type ReportFixFunction = (
fixer: RuleFixer,
) => null | RuleFix | RuleFix[] | IterableIterator<RuleFix>;

type ReportFixFunction = (
  fixer: RuleFixer,
- ) => null | RuleFix | RuleFix[] | IterableIterator<RuleFix>;
+ ) => null | RuleFix | readonly RuleFix[] | IterableIterator<RuleFix>;

Versions

package version
@typescript-eslint/experimental-utils 4.29.3
TypeScript 4.4.2
node 12.22.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: utilsIssues related to the @typescript-eslint/utils package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0