File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,18 +147,22 @@ async function getTools(
147147 }
148148
149149 const options = [
150- { value : 'biome' , label : 'Biome ( linting & formatting) ' } ,
151- { value : 'eslint' , label : 'ESLint ( linting) ' } ,
152- { value : 'prettier' , label : 'Prettier ( formatting) ' } ,
150+ { value : 'biome' , label : 'Biome - linting & formatting' } ,
151+ { value : 'eslint' , label : 'ESLint - linting' } ,
152+ { value : 'prettier' , label : 'Prettier - formatting' } ,
153153 ] ;
154154
155155 if ( extraTools ) {
156+ const normalize = ( tool : ExtraTool ) => ( {
157+ value : tool . value ,
158+ label : tool . label ,
159+ hint : tool . command ,
160+ } ) ;
161+ options . unshift (
162+ ...extraTools . filter ( ( tool ) => tool . order === 'pre' ) . map ( normalize ) ,
163+ ) ;
156164 options . push (
157- ...extraTools . map ( ( tool ) => ( {
158- value : tool . value ,
159- label : tool . label ,
160- hint : tool . command ,
161- } ) ) ,
165+ ...extraTools . filter ( ( tool ) => tool . order !== 'pre' ) . map ( normalize ) ,
162166 ) ;
163167 }
164168
@@ -230,6 +234,10 @@ type ExtraTool = {
230234 * The custom command to run when the tool is selected.
231235 */
232236 command ?: string ;
237+ /**
238+ * Specify the display order
239+ */
240+ order ?: 'pre' | 'post' ;
233241} ;
234242
235243function runCommand ( command : string , cwd : string , packageManager : string ) {
You can’t perform that action at this time.
0 commit comments