File tree 12 files changed +284
-233
lines changed
12 files changed +284
-233
lines changed Original file line number Diff line number Diff line change
1
+ export * from "./lib" ;
Original file line number Diff line number Diff line change
1
+ module . exports = require ( './lib' ) . default ;
2
+ module . exports . default = module . exports ;
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ preset : 'ts-jest' ,
3
+ testEnvironment : 'node'
4
+ } ;
Original file line number Diff line number Diff line change 2
2
"name" : " @commitlint/is-ignored" ,
3
3
"version" : " 8.0.0" ,
4
4
"description" : " Lint your commit messages" ,
5
- "main" : " lib/index.js" ,
6
5
"files" : [
7
6
" lib/"
8
7
],
9
8
"scripts" : {
10
- "build" : " cross-env NODE_ENV=production babel src --out-dir lib --source-maps " ,
9
+ "build" : " tsc " ,
11
10
"deps" : " dep-check" ,
12
11
"pkg" : " pkg-check" ,
13
- "start" : " concurrently \" ava -c 4 --verbose --watch\" \" yarn run watch\" " ,
14
- "test" : " ava -c 4 --verbose" ,
15
- "watch" : " babel src --out-dir lib --watch --source-maps"
16
- },
17
- "ava" : {
18
- "files" : [
19
- " src/**/*.test.js" ,
20
- " !lib/**/*"
21
- ],
22
- "source" : [
23
- " src/**/*.js" ,
24
- " !lib/**/*"
25
- ],
26
- "babel" : " inherit" ,
27
- "require" : [
28
- " babel-register"
29
- ]
30
- },
31
- "babel" : {
32
- "presets" : [
33
- " babel-preset-commitlint"
34
- ]
12
+ "start" : " concurrently \" jest --watchAll\" \" tsc -w\" " ,
13
+ "test" : " jest" ,
14
+ "watch" : " tsc -w"
35
15
},
36
16
"engines" : {
37
17
"node" : " >=4"
56
36
},
57
37
"license" : " MIT" ,
58
38
"devDependencies" : {
59
- "@commitlint/parse" : " ^ 8.0.0" ,
39
+ "@commitlint/parse" : " 8.0.0" ,
60
40
"@commitlint/test" : " 8.0.0" ,
61
- "@commitlint/utils" : " ^8.0.0" ,
62
- "ava" : " 0.22.0" ,
63
- "babel-cli" : " 6.26.0" ,
64
- "babel-preset-commitlint" : " ^8.0.0" ,
65
- "babel-register" : " 6.26.0" ,
41
+ "@commitlint/utils" : " 8.0.0" ,
42
+ "@types/jest" : " ^24.0.13" ,
66
43
"concurrently" : " 3.5.1" ,
67
- "cross-env" : " 5.1.1"
44
+ "jest" : " ^24.8.0" ,
45
+ "ts-jest" : " ^24.0.2" ,
46
+ "typescript" : " ^3.5.1"
68
47
},
69
48
"dependencies" : {
49
+ "@types/semver" : " ^6.0.0" ,
70
50
"semver" : " 6.1.1"
71
51
}
72
52
}
Original file line number Diff line number Diff line change
1
+ import semver from 'semver' ;
2
+
3
+ export type Matcher = ( commit : string ) => boolean ;
4
+
5
+ const isSemver = ( c : string ) : boolean => {
6
+ const firstLine = c . split ( '\n' ) . shift ( ) ;
7
+
8
+ if ( typeof firstLine !== 'string' ) {
9
+ return false ;
10
+ }
11
+
12
+ const stripped = firstLine . replace ( / ^ c h o r e ( \( [ ^ ) ] + \) ) ? : / , '' ) . trim ( ) ;
13
+ return semver . valid ( stripped ) !== null ;
14
+ } ;
15
+
16
+ const test = ( r : RegExp ) : ( ( c : string ) => boolean ) => r . test . bind ( r ) ;
17
+
18
+ export const wildcards : Matcher [ ] = [
19
+ test (
20
+ / ^ ( ( M e r g e p u l l r e q u e s t ) | ( M e r g e ( .* ?) i n t o ( .* ?) | ( M e r g e b r a n c h ( .* ?) ) ) (?: \r ? \n ) * $ ) / m
21
+ ) ,
22
+ test ( / ^ ( R | r ) e v e r t ( .* ) / ) ,
23
+ test ( / ^ ( f i x u p | s q u a s h ) ! / ) ,
24
+ isSemver ,
25
+ test ( / ^ M e r g e d ( .* ?) ( i n | i n t o ) ( .* ) / ) ,
26
+ test ( / ^ M e r g e r e m o t e - t r a c k i n g b r a n c h ( .* ) / ) ,
27
+ test ( / ^ A u t o m a t i c m e r g e ( .* ) / ) ,
28
+ test ( / ^ A u t o - m e r g e d ( .* ?) i n t o ( .* ) / )
29
+ ] ;
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ export * from './is-ignored' ;
2
+ export { Matcher } from './defaults' ;
You can’t perform that action at this time.
0 commit comments