File tree 4 files changed +569
-16
lines changed
4 files changed +569
-16
lines changed Original file line number Diff line number Diff line change 7
7
"license" : " MIT" ,
8
8
"scripts" : {
9
9
"build" : " tsc" ,
10
- "lint" : " eslint ./src --ext .ts,.js" ,
10
+ "lint" : " eslint ./src --ext .ts,.js --fix " ,
11
11
"test" : " jest" ,
12
12
"test:watch" : " jest --watchAll" ,
13
- "prettify" : " prettier --write ./src/**/*.{ts,js}" ,
14
13
"ts-node" : " ts-node" ,
15
14
"nodemon" : " nodemon"
16
15
},
31
30
"eslint-plugin-jsx-a11y" : " ^6.2.1" ,
32
31
"eslint-plugin-prettier" : " ^3.0.1" ,
33
32
"eslint-plugin-react" : " ^7.12.4" ,
33
+ "husky" : " ^1.3.1" ,
34
34
"jest" : " ^24.1.0" ,
35
+ "lint-staged" : " ^8.1.4" ,
35
36
"nodemon" : " ^1.18.9" ,
36
37
"prettier" : " ^1.16.4" ,
38
+ "pretty-quick" : " ^1.10.0" ,
37
39
"ts-jest" : " ^23.10.5" ,
38
40
"ts-node" : " ^8.0.2" ,
39
41
"typescript" : " ^3.3.1"
42
+ },
43
+ "husky" : {
44
+ "hooks" : {
45
+ "pre-commit" : " lint-staged"
46
+ }
47
+ },
48
+ "lint-staged" : {
49
+ "*.{js,ts}" : [
50
+ " eslint ./src --ext .ts,.js --fix" ,
51
+ " pretty-quick" ,
52
+ " git add"
53
+ ]
40
54
}
41
55
}
Original file line number Diff line number Diff line change 1
1
import add from './index' ;
2
2
3
3
test ( 'basic test' , ( ) => {
4
- expect ( add ( 2 , 4 ) ) . toBe ( 6 ) ;
4
+ expect ( add ( 2 , 4 , 6 ) ) . toBe ( 12 ) ;
5
5
} ) ;
Original file line number Diff line number Diff line change 1
- export default function add ( x : number , y : number ) : number {
2
- return x + y ;
1
+ export default function add ( x : number , y : number , z : number ) : number {
2
+ return x + y + z ;
3
3
}
You can’t perform that action at this time.
0 commit comments