Skip to content

Commit 27a2076

Browse files
fix eslint error
1 parent fd203f3 commit 27a2076

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

src/games/even.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import playGame from '../index.js';
22

33
import randomNumber from '../utils.js';
44

5-
const questionGame =
6-
'Answer "yes" if the number is even, otherwise answer "no".';
5+
const questionGame = 'Answer "yes" if the number is even, otherwise answer "no".';
76

87
const questionRound = () => {
98
const number = randomNumber(1, 100);

src/games/prime.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import playGame from '../index.js';
22

33
import randomNumber from '../utils.js';
44

5-
const questionGame =
6-
'Answer "yes" if given number is prime. Otherwise answer "no".';
5+
const questionGame = 'Answer "yes" if given number is prime. Otherwise answer "no".';
76

87
const questionRound = () => {
98
const number = randomNumber(1, 10);

src/games/progression.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ const questionRound = () => {
2020
const result = progression()[itemSkip].toString();
2121

2222
const arrProgression = progression();
23-
23+
/* eslint-disable no-unused-vars */
2424
const skipItem = arrProgression.splice([itemSkip], 1, '..');
25-
25+
/* eslint-enable no-unused-vars */
2626
const question = `Question: ${arrProgression.join(' ')}`;
2727

2828
return [question, result];

src/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ const playGame = (questiongame, questionRound) => {
1818
const correctAnsw = round[1];
1919
// вывод неправильного ответа
2020
const wrong = () => {
21-
console.log(
22-
`'${answer}' is wrong answer ;(. Correct answer was '${correctAnsw}'.\nLet's try again, ${userName}!`
23-
);
21+
console.log(`'${answer}' is wrong answer ;(. Correct answer was '${correctAnsw}'.\nLet's try again, ${userName}!`);
2422
};
2523
// проверка
2624
if (answer === correctAnsw) {
@@ -35,7 +33,7 @@ const playGame = (questiongame, questionRound) => {
3533
const winMessage = () => {
3634
console.log(`Congratulations, ${userName}!`);
3735
};
38-
winMessage();
36+
return winMessage();
3937
};
4038

4139
export default playGame;

0 commit comments

Comments
 (0)