Skip to content

Commit 6013640

Browse files
committed
Configured test, lint and hooks
1 parent a058134 commit 6013640

File tree

7 files changed

+43
-22
lines changed

7 files changed

+43
-22
lines changed

.babelrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": {
7+
"node": "current"
8+
}
9+
}
10+
]
11+
]
12+
}

.eslintrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true,
6+
"jest": true
7+
},
8+
"extends": ["airbnb-base"],
9+
"globals": {
10+
"Atomics": "readonly",
11+
"SharedArrayBuffer": "readonly"
12+
},
13+
"parserOptions": {
14+
"ecmaVersion": 2018,
15+
"sourceType": "module"
16+
},
17+
"rules": {}
18+
}

.eslintrc.json

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

.huskyrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "yarn eslint",
4+
"pre-push": "yarn eslint && yarn test"
5+
}
6+
}

__tests__/.gitkeep

Whitespace-only changes.

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "[![License][license-badge]][license-url]",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"test": "jest"
88
},
99
"repository": {
1010
"type": "git",
@@ -18,8 +18,13 @@
1818
},
1919
"homepage": "https://github.com/codevor/js-http-status#readme",
2020
"devDependencies": {
21+
"@babel/core": "^7.6.4",
22+
"@babel/preset-env": "^7.6.3",
23+
"babel-jest": "^24.9.0",
2124
"eslint": "^6.5.1",
2225
"eslint-config-airbnb-base": "^14.0.0",
23-
"eslint-plugin-import": "^2.18.2"
26+
"eslint-plugin-import": "^2.18.2",
27+
"husky": "^3.0.9",
28+
"jest": "^24.9.0"
2429
}
2530
}

src/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)