Skip to content

Commit d4f2e92

Browse files
authored
Merge pull request #4 from oslabs-beta/backend
Backend Update
2 parents d6ed4a2 + 568881c commit d4f2e92

Some content is hidden

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

72 files changed

+10168
-9640
lines changed

.eslintrc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"extends": [
3-
"airbnb",
3+
"airbnb",
44
"plugin:jest/recommended",
55
"plugin:@typescript-eslint/eslint-recommended",
6-
"plugin:@typescript-eslint/recommended"],
6+
"plugin:@typescript-eslint/recommended"
7+
],
78
"root": true,
89
"plugins": ["jest", "react", "react-hooks", "@typescript-eslint"],
910
"rules": {
@@ -13,7 +14,8 @@
1314
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
1415
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
1516
"react/jsx-filename-extension": [0],
16-
"linebreak-style": "off"
17+
"linebreak-style": "off",
18+
"max-len": [{ "ignoreComments": true }]
1719
},
1820
"env": {
1921
"es6": true,
@@ -33,4 +35,4 @@
3335
"ecmaVersion": 2018,
3436
"sourceType": "module"
3537
}
36-
}
38+
}

demo-app/src/client/Components/Board.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Board extends Component<{}, BoardState> {
1818
currentPlayer: 'X',
1919
gameOver: false,
2020
message: '',
21-
scoreboard: { X: 0, O: 0 }
21+
scoreboard: { X: 0, O: 0 },
2222
};
2323

2424
this.resetBoard = this.resetBoard.bind(this);
@@ -38,7 +38,7 @@ class Board extends Component<{}, BoardState> {
3838
return [
3939
['-', '-', '-'],
4040
['-', '-', '-'],
41-
['-', '-', '-']
41+
['-', '-', '-'],
4242
];
4343
}
4444

@@ -51,7 +51,7 @@ class Board extends Component<{}, BoardState> {
5151
this.setState({
5252
gameOver: false,
5353
board: this.newBoard(),
54-
message: ''
54+
message: '',
5555
});
5656
}
5757

@@ -87,14 +87,14 @@ class Board extends Component<{}, BoardState> {
8787

8888
this.setState({
8989
gameOver: true,
90-
message: `Player ${winner} wins!`
90+
message: `Player ${winner} wins!`,
9191
});
9292

9393
// draw condition: no '-' remaining in board without above win condition triggering
9494
} else if (!spacesLeft()) {
9595
this.setState({
9696
gameOver: true,
97-
message: 'Draw!'
97+
message: 'Draw!',
9898
});
9999
}
100100
}
@@ -104,7 +104,7 @@ class Board extends Component<{}, BoardState> {
104104
const boardCopy: BoardContent = [
105105
[...this.state.board[0]],
106106
[...this.state.board[1]],
107-
[...this.state.board[2]]
107+
[...this.state.board[2]],
108108
];
109109
boardCopy[row][column] = this.state.currentPlayer;
110110
const newPlayer: Player = this.state.currentPlayer === 'X' ? 'O' : 'X';
@@ -115,7 +115,7 @@ class Board extends Component<{}, BoardState> {
115115
const rows: Array<JSX.Element> = [];
116116
for (let i = 0; i < 3; i++) {
117117
rows.push(
118-
<Row key={i} row={i} handleBoxClick={this.handleBoxClick} values={this.state.board[i]} />
118+
<Row key={i} row={i} handleBoxClick={this.handleBoxClick} values={this.state.board[i]} />,
119119
);
120120
}
121121
const { X, O }: Scoreboard = this.state.scoreboard;

demo-app/src/client/Components/Row.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Row = (props: RowProps) => {
1818
column={i}
1919
handleBoxClick={props.handleBoxClick}
2020
value={props.values[i]}
21-
></Box>
21+
></Box>,
2222
);
2323
}
2424

demo-app/src/client/Router.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ ReactDOM.render(
1717
<Route path='/buttons' element={<Buttons />} />
1818
</Routes>
1919
</BrowserRouter>,
20-
root
20+
root,
2121
);

demo-app/webpack.config.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
entry: './src/client/Router.tsx',
88
output: {
99
path: path.resolve(__dirname, 'dist'),
10-
filename: 'bundle.js'
10+
filename: 'bundle.js',
1111
},
1212
module: {
1313
rules: [
@@ -17,37 +17,37 @@ module.exports = {
1717
use: {
1818
loader: 'babel-loader',
1919
options: {
20-
presets: ['@babel/preset-env', '@babel/preset-react']
21-
}
22-
}
20+
presets: ['@babel/preset-env', '@babel/preset-react'],
21+
},
22+
},
2323
},
2424
{
2525
test: /\.tsx?$/,
2626
use: 'ts-loader',
27-
exclude: /node_modules/
28-
}
29-
]
27+
exclude: /node_modules/,
28+
},
29+
],
3030
},
3131
resolve: {
32-
extensions: ['.jsx', '.js', '.ts', '.tsx']
32+
extensions: ['.jsx', '.js', '.ts', '.tsx'],
3333
},
3434
plugins: [
3535
new HtmlWebpackPlugin({
3636
template: './src/client/index.html',
37-
filename: './index.html'
37+
filename: './index.html',
3838
}),
3939
new CopyPlugin({
40-
patterns: [{ from: './src/client/style.css' }]
41-
})
40+
patterns: [{ from: './src/client/style.css' }],
41+
}),
4242
],
4343
devServer: {
4444
historyApiFallback: true,
4545
static: {
46-
directory: path.join(__dirname, './dist')
46+
directory: path.join(__dirname, './dist'),
4747
},
4848
proxy: {
4949
'/api': 'http://localhost:3000',
50-
secure: false
51-
}
52-
}
50+
secure: false,
51+
},
52+
},
5353
};

docs/assets/js/main.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
},
6666
contains: function () {
6767
return !0;
68-
}
68+
},
6969
}),
7070
(e.Set.empty = {
7171
intersect: function () {
@@ -76,7 +76,7 @@
7676
},
7777
contains: function () {
7878
return !1;
79-
}
79+
},
8080
}),
8181
(e.Set.prototype.contains = function (e) {
8282
return !!this.elements[e];
@@ -161,7 +161,7 @@
161161
(t.label && t.label in this.registeredFunctions) ||
162162
e.utils.warn(
163163
'Function is not registered with pipeline. This may cause problems when serialising the index.\n',
164-
t
164+
t,
165165
);
166166
}),
167167
(e.Pipeline.load = function (t) {
@@ -317,17 +317,17 @@
317317
aliti: 'al',
318318
iviti: 'ive',
319319
biliti: 'ble',
320-
logi: 'log'
320+
logi: 'log',
321321
},
322322
t = { icate: 'ic', ative: '', alize: 'al', iciti: 'ic', ical: 'ic', ful: '', ness: '' },
323323
i = '[aeiouy]',
324324
n = '[^aeiou][^aeiouy]*',
325325
c = new RegExp('^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*'),
326326
h = new RegExp(
327-
'^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*'
327+
'^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*',
328328
),
329329
d = new RegExp(
330-
'^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$'
330+
'^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$',
331331
),
332332
f = new RegExp('^([^aeiou][^aeiouy]*)?[aeiouy]'),
333333
p = /^(.+?)(ss|i)es$/,
@@ -523,7 +523,7 @@
523523
'would',
524524
'yet',
525525
'you',
526-
'your'
526+
'your',
527527
])),
528528
e.Pipeline.registerFunction(e.stopWordFilter, 'stopWordFilter'),
529529
(e.trimmer = function (e) {
@@ -834,7 +834,7 @@
834834
fields: this.fields,
835835
fieldVectors: r,
836836
invertedIndex: t,
837-
pipeline: this.pipeline.toJSON()
837+
pipeline: this.pipeline.toJSON(),
838838
};
839839
}),
840840
(e.Index.load = function (t) {
@@ -851,7 +851,7 @@
851851
e.version +
852852
"' does not match serialized index '" +
853853
t.version +
854-
"'"
854+
"'",
855855
);
856856
for (var l = 0; l < n.length; l++) {
857857
var h = (c = n[l])[0],
@@ -1012,7 +1012,7 @@
10121012
fieldVectors: this.fieldVectors,
10131013
tokenSet: this.tokenSet,
10141014
fields: Object.keys(this._fields),
1015-
pipeline: this.searchPipeline
1015+
pipeline: this.searchPipeline,
10161016
})
10171017
);
10181018
}),
@@ -1423,7 +1423,7 @@ var typedoc,
14231423
selector: selector,
14241424
constructor: constructor,
14251425
priority: priority,
1426-
namespace: namespace
1426+
namespace: namespace,
14271427
}),
14281428
components.sort(function (a, b) {
14291429
return a.priority - b.priority;
@@ -1506,13 +1506,13 @@ var typedoc,
15061506
'scroll',
15071507
typedoc.throttle(function () {
15081508
return _this.onScroll();
1509-
}, 10)
1509+
}, 10),
15101510
),
15111511
window.addEventListener(
15121512
'resize',
15131513
typedoc.throttle(function () {
15141514
return _this.onResize();
1515-
}, 10)
1515+
}, 10),
15161516
),
15171517
_this.onResize(),
15181518
_this.onScroll(),
@@ -1523,14 +1523,14 @@ var typedoc,
15231523
__extends(Viewport, _super),
15241524
(Viewport.prototype.triggerResize = function () {
15251525
var event = new CustomEvent('resize', {
1526-
detail: { width: this.width, height: this.height }
1526+
detail: { width: this.width, height: this.height },
15271527
});
15281528
this.dispatchEvent(event);
15291529
}),
15301530
(Viewport.prototype.onResize = function () {
15311531
(this.width = window.innerWidth || 0), (this.height = window.innerHeight || 0);
15321532
var event = new CustomEvent('resize', {
1533-
detail: { width: this.width, height: this.height }
1533+
detail: { width: this.width, height: this.height },
15341534
});
15351535
this.dispatchEvent(event);
15361536
}),
@@ -1568,7 +1568,7 @@ var typedoc,
15681568
(typedoc.isPointerTouch = !1),
15691569
(typedoc.hasPointerMoved = !1),
15701570
(typedoc.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
1571-
navigator.userAgent
1571+
navigator.userAgent,
15721572
)),
15731573
document.documentElement.classList.add(typedoc.isMobile ? 'is-mobile' : 'not-mobile'),
15741574
typedoc.isMobile &&
@@ -1642,7 +1642,7 @@ var typedoc,
16421642
((this.checkbox.checked = this.value),
16431643
document.documentElement.classList.toggle(
16441644
'toggle-' + this.key,
1645-
this.value != this.defaultValue
1645+
this.value != this.defaultValue,
16461646
));
16471647
}),
16481648
(FilterItemCheckbox.prototype.fromLocalStorage = function (value) {
@@ -1775,7 +1775,7 @@ var typedoc,
17751775
return a.position - b.position;
17761776
});
17771777
var event = new CustomEvent('scroll', {
1778-
detail: { scrollTop: typedoc.viewport.scrollTop }
1778+
detail: { scrollTop: typedoc.viewport.scrollTop },
17791779
});
17801780
this.onScroll(event);
17811781
}),
@@ -1912,7 +1912,7 @@ var typedoc,
19121912
rel && (current.classList.remove('current'), rel.classList.add('current'));
19131913
} else
19141914
(current = this.results.querySelector(
1915-
1 == dir ? 'li:first-child' : 'li:last-child'
1915+
1 == dir ? 'li:first-child' : 'li:last-child',
19161916
)) && current.classList.add('current');
19171917
}),
19181918
(Search.prototype.gotoCurrentResult = function () {

0 commit comments

Comments
 (0)