File tree Expand file tree Collapse file tree 6 files changed +18
-11
lines changed Expand file tree Collapse file tree 6 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 1
1
import { type UserConfig } from '@commitlint/types' ;
2
2
import spendPlugin from './index' ;
3
3
4
- export default {
4
+ const config : UserConfig = {
5
5
extends : [ `@commitlint/config-conventional` ] ,
6
6
rules : {
7
7
spend : [ 2 , `always` ] ,
8
8
} ,
9
9
plugins : [ spendPlugin ] ,
10
- } satisfies UserConfig ;
10
+ } ;
11
+
12
+ export default config ;
Original file line number Diff line number Diff line change 1
1
import type { Plugin } from '@commitlint/types' ;
2
2
import { validateCommitMsg } from './src/utils/validateCommitMsg/validateCommitMsg' ;
3
3
4
- export default {
4
+ const spendPlugin : Plugin = {
5
5
rules : {
6
6
spend : validateCommitMsg ,
7
7
} ,
8
- } satisfies Plugin ;
8
+ } ;
9
+
10
+ export default spendPlugin ;
Original file line number Diff line number Diff line change 34
34
"url" : " https://github.com/nico-i/commitlint-plugin-spend/issues"
35
35
},
36
36
"scripts" : {
37
- "build" : " bun build ./index.ts --outdir ./out --minify" ,
37
+ "build" : " bun build ./index.ts --outdir ./out --minify && bunx tsc " ,
38
38
"lint" : " eslint . --ext .ts && prettier . --check" ,
39
39
"lint:fix" : " eslint . --ext .ts --fix && prettier . --write" ,
40
40
"prepare" : " husky || true"
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export type SpendCommand = (typeof spendingCommands)[number];
8
8
9
9
export const spendCommandPattern = new RegExp (
10
10
`^(${ spendingCommands . join ( `|` ) } )$` ,
11
- ) ;
11
+ ) as RegExp ;
12
12
13
13
export function isSpendCommand ( value : string ) : value is SpendCommand {
14
14
return spendingCommands . includes ( value as SpendCommand ) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export type TimeValue = `${number}${TimeUnit}`;
21
21
*/
22
22
export const timeValuePattern = new RegExp (
23
23
`^(\\d{1,2})(${ orderedTimeUnits . join ( `|` ) } )$` ,
24
- ) ;
24
+ ) as RegExp ;
25
25
26
26
export function isTimeValue ( value : string ) : value is TimeValue {
27
27
return timeValuePattern . test ( value ) ;
Original file line number Diff line number Diff line change 1
1
{
2
+ "include" : [" src/**/*" , " index.ts" ],
2
3
"compilerOptions" : {
3
4
// Environment setup & latest features
4
5
"lib" : [" ESNext" ],
5
6
"target" : " ESNext" ,
6
7
"module" : " Preserve" ,
7
8
"moduleDetection" : " force" ,
8
9
"jsx" : " react-jsx" ,
9
- "allowJs" : true ,
10
10
11
11
// Bundler mode
12
12
"moduleResolution" : " bundler" ,
13
- "allowImportingTsExtensions" : true ,
14
13
"verbatimModuleSyntax" : true ,
15
- "noEmit" : true ,
14
+ "emitDeclarationOnly" : true ,
15
+ "isolatedDeclarations" : true ,
16
16
17
17
// Best practices
18
18
"strict" : true ,
24
24
// Some stricter flags (disabled by default)
25
25
"noUnusedLocals" : false ,
26
26
"noUnusedParameters" : false ,
27
- "noPropertyAccessFromIndexSignature" : false
27
+ "noPropertyAccessFromIndexSignature" : false ,
28
+
29
+ "declaration" : true ,
30
+ "outDir" : " out"
28
31
}
29
32
}
You can’t perform that action at this time.
0 commit comments