Skip to content

Commit a30c544

Browse files
committed
feat: add husky pre-commit
1 parent e87d5d0 commit a30c544

File tree

5 files changed

+39
-34
lines changed

5 files changed

+39
-34
lines changed

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged --allow-empty

.prettierrc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"semi": true,
3-
"tabWidth": 4,
4-
"printWidth": 80,
5-
"singleQuote": true,
6-
"bracketSpacing": false,
7-
"bracketSameLine": true
2+
"semi": true,
3+
"tabWidth": 4,
4+
"printWidth": 80,
5+
"singleQuote": true,
6+
"bracketSpacing": false,
7+
"bracketSameLine": true
88
}

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
## Как пользоваться
44

55
Для того, чтобы всё корректно работало, у вас должен быть установлен [node](https://nodejs.org/en/) и [git](https://git-scm.com/)
6-
* Скачайте проект к себе. Есть 3 способа:
7-
- Сачайте проект как архив
8-
- Склонируйте текущий репозиторий и пересоздайте гит репозиторий (либо же указываем новый remote на свой репозиторий)
9-
- Сделайте fork репозитория и склонируйте его к себе
10-
* Перед тем, как начать делать домашние задания, выполните `npm install`
11-
* Чтобы проверить решения заданий с тестами, используйте `npm test`
6+
7+
- Скачайте проект к себе. Есть 3 способа:
8+
- Сачайте проект как архив
9+
- Склонируйте текущий репозиторий и пересоздайте гит репозиторий (либо же указываем новый remote на свой репозиторий)
10+
- Сделайте fork репозитория и склонируйте его к себе
11+
- Перед тем, как начать делать домашние задания, выполните `npm install`
12+
- Чтобы проверить решения заданий с тестами, используйте `npm test`

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"name": "js-basic",
3-
"version": "1.0.0",
4-
"description": "",
5-
"main": "index.js",
6-
"author": "",
7-
"scripts": {
8-
"test": "mocha src",
9-
"prepare": "husky install",
10-
"prettier": "prettier -w .",
11-
"prettier:check": "prettier -c ."
12-
},
13-
"license": "ISC",
14-
"devDependencies": {
15-
"husky": "^8.0.1",
16-
"lint-staged": "^13.0.3",
17-
"mocha": "^10.1.0",
18-
"prettier": "2.7.1"
19-
},
20-
"lint-staged": {
21-
"**/*": "prettier --write ."
22-
}
2+
"name": "js-basic",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"author": "",
7+
"scripts": {
8+
"test": "mocha src",
9+
"prepare": "husky install",
10+
"prettier": "prettier -w .",
11+
"prettier:check": "prettier -c ."
12+
},
13+
"license": "ISC",
14+
"devDependencies": {
15+
"husky": "^8.0.1",
16+
"lint-staged": "^13.0.3",
17+
"mocha": "^10.1.0",
18+
"prettier": "2.7.1"
19+
},
20+
"lint-staged": {
21+
"**/*": "prettier --write ."
22+
}
2323
}

src/core.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('Задания core js', () => {
4545
assert.equal(core.isBinary(2), true);
4646
assert.equal(core.isBinary(2048), true);
4747
});
48-
48+
4949
it('Возвращает false при передаче не степени двойки', () => {
5050
assert.equal(core.isBinary(0), false);
5151
assert.equal(core.isBinary(12), false);

0 commit comments

Comments
 (0)