@@ -5,6 +5,7 @@ import type { RslibConfigDefinition } from '@rslib/core';
55import type { RslintConfig } from '@rslint/core' ;
66import type { UserConfig , UserConfigAsyncFn } from '@rspress/core' ;
77import type { RstestConfigExport } from '@rstest/core' ;
8+ import type { FmtConfigDefinition } from './fmt/types.ts' ;
89import type { StagedConfig } from './staged.ts' ;
910
1011export type RslintConfigDefinition = RslintConfig | ( ( ) => Promise < RslintConfig > ) ;
@@ -16,6 +17,7 @@ export type Configs = {
1617 doc ?: RspressConfigDefinition ;
1718 test ?: RstestConfigExport ;
1819 lint ?: RslintConfigDefinition ;
20+ fmt ?: FmtConfigDefinition ;
1921 staged ?: StagedConfig ;
2022} ;
2123
@@ -106,6 +108,12 @@ type Define = {
106108 * This config is used by the `rs lint` command.
107109 */
108110 lint : ( config : RslintConfig | ( ( ) => Promise < RslintConfig > ) ) => void ;
111+ /**
112+ * Defines the Prettier config for formatting.
113+ *
114+ * This config will be used by the `rs fmt` command.
115+ */
116+ fmt : ( config : FmtConfigDefinition ) => void ;
109117 /**
110118 * Defines the lint-staged config for staged files.
111119 *
@@ -133,6 +141,7 @@ export const define: Define = {
133141 doc : ( config ) => setConfig ( 'doc' , config ) ,
134142 test : ( config ) => setConfig ( 'test' , config ) ,
135143 lint : ( config ) => setConfig ( 'lint' , config ) ,
144+ fmt : ( config ) => setConfig ( 'fmt' , config ) ,
136145 staged : ( config ) => setConfig ( 'staged' , config ) ,
137146} ;
138147
0 commit comments