Skip to content

Commit

Permalink
test: add .eslintrc.js and sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
toshi-toma committed Jun 27, 2019
1 parent a18ff4b commit 4de54e3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("./index.js");
16 changes: 16 additions & 0 deletions test/sample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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 });
19 changes: 19 additions & 0 deletions test/sample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React, { FC } from "react";

const Foo = () => <p>Foo</p>;
const Component = () => <Foo />;

interface Props {
name: string;
age: number;
}
const ComponentWithProps: FC<Props> = ({ name, age }) => (
<p>
{name}, {age}
</p>
);

export default {
Component,
ComponentWithProps
};

0 comments on commit 4de54e3

Please sign in to comment.