Skip to content

Commit

Permalink
docs(eslint-plugin): [prefer-readonly-parameter-types] fix broken cod…
Browse files Browse the repository at this point in the history
…e samples (#8135)

* docs(eslint-plugin): [prefer-readonly-parameter-types] fix broken code samples
  • Loading branch information
auvred committed Dec 26, 2023
1 parent 7246e56 commit cde4d4d
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ interface Foo {
interface Foo {
new (arg: string[]): void;
}
const x = { foo(arg: string[]): void; };
const x = { foo(arg: string[]): void {} };
function foo(arg: string[]);
type Foo = (arg: string[]) => void;
interface Foo {
Expand Down Expand Up @@ -91,7 +91,7 @@ interface CustomFunction {
}
function custom2(arg: CustomFunction) {}

function union(arg: readonly string[] | ReadonlyArray<number[]>) {}
function union(arg: readonly string[] | ReadonlyArray<number>) {}

function primitive1(arg: string) {}
function primitive2(arg: number) {}
Expand All @@ -105,8 +105,11 @@ function primitive9(arg: string | number | undefined) {}

function fnSig(arg: () => void) {}

enum Foo { a, b }
function enum(arg: Foo) {}
enum Foo {
a,
b,
}
function enumArg(arg: Foo) {}

function symb1(arg: symbol) {}
const customSymbol = Symbol('a');
Expand All @@ -119,7 +122,7 @@ interface Foo {
interface Foo {
new (arg: readonly string[]): void;
}
const x = { foo(arg: readonly string[]): void; };
const x = { foo(arg: readonly string[]): void {} };
function foo(arg: readonly string[]);
type Foo = (arg: readonly string[]) => void;
interface Foo {
Expand Down

0 comments on commit cde4d4d

Please sign in to comment.