Skip to content

Commit e11b943

Browse files
committed
Merge branch 'dev' into feature-hooks
2 parents aa4b5ba + 27ee4e1 commit e11b943

File tree

86 files changed

+1557
-592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1557
-592
lines changed

.babelrc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"presets": [
3-
"airbnb"
4-
],
2+
"presets": ["airbnb", "@babel/preset-typescript"],
53
"plugins": ["@emotion"]
64
}

.eslintrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
"airbnb",
44
"plugin:jest/recommended",
55
"plugin:@typescript-eslint/eslint-recommended",
6-
"plugin:@typescript-eslint/recommended"
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:testing-library/react", // added in for RTL tests
8+
"plugin:jest-dom/recommended" // added in for RTL tests
79
],
810
"root": true,
9-
"plugins": ["jest", "react", "react-hooks", "@typescript-eslint"],
11+
"plugins": ["jest", "react", "react-hooks", "@typescript-eslint", "testing-library", "jest-dom"],
1012
"rules": {
1113
"arrow-parens": [2, "as-needed"],
1214
"import/no-unresolved": "off",

demo-app-next/src/components/Board.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from "react";
22
import Row from "./Row";
3-
import { BoardText, BoardContent, Scoreboard, Player } from "../types/types";
3+
import { BoardContent, Scoreboard, Player } from "../types/types";
44

55
type BoardState = {
66
board: BoardContent;
@@ -11,7 +11,7 @@ type BoardState = {
1111
};
1212

1313
class Board extends Component<{}, BoardState> {
14-
constructor(props: any) {
14+
constructor(props: unknown) {
1515
super(props);
1616
this.state = {
1717
board: this.newBoard(),
@@ -25,7 +25,7 @@ class Board extends Component<{}, BoardState> {
2525
this.handleBoxClick = this.handleBoxClick.bind(this);
2626
}
2727

28-
componentDidUpdate() {
28+
componentDidUpdate():void {
2929
this.checkForWinner();
3030
}
3131

@@ -127,7 +127,7 @@ class Board extends Component<{}, BoardState> {
127127
this.setState({ board: boardCopy, currentPlayer: newPlayer });
128128
}
129129

130-
render() {
130+
render(): JSX.Element {
131131
const rows: Array<JSX.Element> = [];
132132
for (let i = 0; i < 3; i++) {
133133
rows.push(
@@ -139,7 +139,7 @@ class Board extends Component<{}, BoardState> {
139139
/>
140140
);
141141
}
142-
const { X, O }: Scoreboard = this.state.scoreboard;
142+
// const { X, O }: Scoreboard = this.state.scoreboard;
143143

144144
return (
145145
<div className="board">

demo-app-next/src/components/Box.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type BoxProps = {
77
handleBoxClick: (row: number, column: number) => void;
88
};
99

10-
const Box = (props: BoxProps) => {
10+
const Box = (props: BoxProps): JSX.Element => {
1111
return (
1212
<button
1313
className="box"

demo-app-next/src/components/Buttons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Increment from './Increment';
22

3-
export default function Buttons() {
3+
export default function Buttons(): JSX.Element {
44
const buttons = [];
55
for (let i = 0; i < 4; i++) {
66
buttons.push(<Increment key={i} />);

demo-app-next/src/components/Increment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState } from "react";
22

3-
export default function Increment() {
3+
export default function Increment(): JSX.Element {
44
const [count, setCount] = useState(0);
55

66
return (

demo-app-next/src/components/navbar.js renamed to demo-app-next/src/components/navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Link from 'next/link';
22

3-
export default function Navbar() {
3+
export default function Navbar(): JSX.Element {
44
return (
55
<div className='nav'>
66
<Link className='link' href='/'>

demo-app-next/src/pages/_app.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

demo-app-next/src/pages/_app.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import "../../styles/style.css";
2+
import React from "react"
3+
4+
export default function MyApp({ Component, pageProps }): JSX.Element {
5+
return <Component {...pageProps} />;
6+
}

demo-app-next/src/pages/buttons/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Buttons from "../../components/Buttons";
22
import Navbar from "../../components/navbar";
33

4-
export default function ButtonsPage() {
4+
export default function ButtonsPage(): JSX.Element {
55
return (
66
<div>
77
<Navbar />

0 commit comments

Comments
 (0)