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 11import { type UserConfig } from '@commitlint/types' ;
22import spendPlugin from './index' ;
33
4- export default {
4+ const config : UserConfig = {
55 extends : [ `@commitlint/config-conventional` ] ,
66 rules : {
77 spend : [ 2 , `always` ] ,
88 } ,
99 plugins : [ spendPlugin ] ,
10- } satisfies UserConfig ;
10+ } ;
11+
12+ export default config ;
Original file line number Diff line number Diff line change 11import type { Plugin } from '@commitlint/types' ;
22import { validateCommitMsg } from './src/utils/validateCommitMsg/validateCommitMsg' ;
33
4- export default {
4+ const spendPlugin : Plugin = {
55 rules : {
66 spend : validateCommitMsg ,
77 } ,
8- } satisfies Plugin ;
8+ } ;
9+
10+ export default spendPlugin ;
Original file line number Diff line number Diff line change 3434 "url" : " https://github.com/nico-i/commitlint-plugin-spend/issues"
3535 },
3636 "scripts" : {
37- "build" : " bun build ./index.ts --outdir ./out --minify" ,
37+ "build" : " bun build ./index.ts --outdir ./out --minify && bunx tsc " ,
3838 "lint" : " eslint . --ext .ts && prettier . --check" ,
3939 "lint:fix" : " eslint . --ext .ts --fix && prettier . --write" ,
4040 "prepare" : " husky || true"
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export type SpendCommand = (typeof spendingCommands)[number];
88
99export const spendCommandPattern = new RegExp (
1010 `^(${ spendingCommands . join ( `|` ) } )$` ,
11- ) ;
11+ ) as RegExp ;
1212
1313export function isSpendCommand ( value : string ) : value is SpendCommand {
1414 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}`;
2121 */
2222export const timeValuePattern = new RegExp (
2323 `^(\\d{1,2})(${ orderedTimeUnits . join ( `|` ) } )$` ,
24- ) ;
24+ ) as RegExp ;
2525
2626export function isTimeValue ( value : string ) : value is TimeValue {
2727 return timeValuePattern . test ( value ) ;
Original file line number Diff line number Diff line change 11{
2+ "include" : [" src/**/*" , " index.ts" ],
23 "compilerOptions" : {
34 // Environment setup & latest features
45 "lib" : [" ESNext" ],
56 "target" : " ESNext" ,
67 "module" : " Preserve" ,
78 "moduleDetection" : " force" ,
89 "jsx" : " react-jsx" ,
9- "allowJs" : true ,
1010
1111 // Bundler mode
1212 "moduleResolution" : " bundler" ,
13- "allowImportingTsExtensions" : true ,
1413 "verbatimModuleSyntax" : true ,
15- "noEmit" : true ,
14+ "emitDeclarationOnly" : true ,
15+ "isolatedDeclarations" : true ,
1616
1717 // Best practices
1818 "strict" : true ,
2424 // Some stricter flags (disabled by default)
2525 "noUnusedLocals" : false ,
2626 "noUnusedParameters" : false ,
27- "noPropertyAccessFromIndexSignature" : false
27+ "noPropertyAccessFromIndexSignature" : false ,
28+
29+ "declaration" : true ,
30+ "outDir" : " out"
2831 }
2932}
You can’t perform that action at this time.
0 commit comments