-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use no-shadow of @typescript-eslint instead of base rule (#71)
- Loading branch information
Showing
3 changed files
with
20 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
import { Person, SampleData } from "./sampleTypes"; | ||
|
||
function sum(a: number, b: number) { | ||
return a + b; | ||
} | ||
|
||
sum(1, 2); | ||
|
||
interface Person { | ||
name: string; | ||
age: number; | ||
} | ||
|
||
function greeter(person: Person) { | ||
return `My name is ${person.name}. I am ${person.age} years old.`; | ||
} | ||
|
||
greeter({ name: "toshi-toma", age: 24 }); | ||
|
||
function greeterWithEnum(person: SampleData) { | ||
return `My name is ${person.name}. I am ${person.age} years old.`; | ||
} | ||
|
||
greeterWithEnum({ name: SampleData.name, age: SampleData.age }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export interface Person { | ||
name: string; | ||
age: number; | ||
} | ||
|
||
export const enum SampleData { | ||
name = "toshi-toma", | ||
age = 24, | ||
} |