File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
custom-templates/typescript Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 66 - main
77 paths :
88 - ' types/codegen/schema/**'
9- workflow_dispatch :
109
1110jobs :
1211 validate-pr :
2120 uses : actions/setup-node@v4
2221 with :
2322 node-version : ' 20.x'
24- # should we cache: 'npm'
2523
2624 - name : Install root dependencies
2725 working-directory : .
Original file line number Diff line number Diff line change 1- /* tslint:disable */
2- /* eslint-disable */
31{ {! This is a comment. Removed the export of runtimes because we do not need
42those functions. Was causing error because exported a def called ResponseError
53which is also used by vscode LSP} }
Original file line number Diff line number Diff line change @@ -78,12 +78,19 @@ const importResult = processImportMappings()
7878// Read the generated index.ts file
7979let indexContent = fs . readFileSync ( indexPath , 'utf8' )
8080
81- // Find the position after existing imports
82- const importEndPos = indexContent . lastIndexOf ( 'import' )
81+ // Find the insertion position - either at top of file or after lint disable comments
8382let insertPos = 0
8483
85- if ( importEndPos !== - 1 ) {
86- insertPos = indexContent . indexOf ( '\n' , importEndPos ) + 1
84+ // Check if file starts with lint disable comments
85+ const lintDisablePattern = / ^ ( \s * \/ \* \s * t s l i n t : d i s a b l e \s * \* \/ \s * \/ \* \s * e s l i n t - d i s a b l e \s * \* \/ \s * ) /
86+ const lintDisableMatch = indexContent . match ( lintDisablePattern )
87+
88+ if ( lintDisableMatch ) {
89+ // Insert after the lint disable comments
90+ insertPos = lintDisableMatch [ 0 ] . length
91+ } else {
92+ // Insert at the very top of the file
93+ insertPos = 0
8794}
8895
8996// Insert import statements and constants after existing imports
You can’t perform that action at this time.
0 commit comments