File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11module . exports = {
22 root : true ,
3- extends : '@block65' ,
3+ extends : [ '@block65/eslint-config' , '@block65/eslint-config/typescript' ] ,
44 parserOptions : {
55 tsconfigRootDir : __dirname ,
66 project : './tsconfig.json' ,
Original file line number Diff line number Diff line change 195195 },
196196 {
197197 "type" : " object" ,
198- "required" : [
199- " id"
200- ],
198+ "required" : [" id" ],
201199 "properties" : {
202200 "id" : {
203201 "type" : " integer" ,
209207 },
210208 "NewPet" : {
211209 "type" : " object" ,
212- "required" : [
213- " name"
214- ],
210+ "required" : [" name" ],
215211 "properties" : {
216212 "name" : {
217213 "type" : " string"
223219 },
224220 "Error" : {
225221 "type" : " object" ,
226- "required" : [
227- " code" ,
228- " message"
229- ],
222+ "required" : [" code" , " message" ],
230223 "properties" : {
231224 "code" : {
232225 "type" : " integer" ,
Original file line number Diff line number Diff line change 66 * Generated on 2022-10-29T14:54:27.697Z
77 *
88 */
9+ import type { Simplify } from 'type-fest' ;
910import type {
1011 RequestMethodCaller ,
1112 FindPetsQuery ,
1213 Pet ,
1314 NewPet ,
1415} from './models.js' ;
15- import type { Simplify } from 'type-fest' ;
1616
1717/**
1818 * Returns all pets from the system that the user has access to
@@ -47,7 +47,7 @@ export function findPets(parameters?: {
4747} ) : RequestMethodCaller < Pet [ ] > {
4848 const req = {
4949 method : 'get' as const ,
50- pathname : ` /pets` ,
50+ pathname : ' /pets' ,
5151 query : parameters ?. query ,
5252 } ;
5353 return ( requestMethod , options ) => requestMethod ( req , options ) ;
@@ -63,7 +63,7 @@ export function addPet(parameters: {
6363} ) : RequestMethodCaller < Pet > {
6464 const req = {
6565 method : 'post' as const ,
66- pathname : ` /pets` ,
66+ pathname : ' /pets' ,
6767 body : parameters . body ,
6868 } ;
6969 return ( requestMethod , options ) => requestMethod ( req , options ) ;
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
2- import { join } from 'path' ;
2+ import { join } from 'node: path' ;
33import yargs from 'yargs' ;
44import { hideBin } from 'yargs/helpers' ;
55import { build } from '../src/build.js' ;
Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ export async function processOpenApiDocument(
358358
359359 for ( const [ statusCode , response ] of Object . entries (
360360 operationObject . responses ,
361- ) . filter ( ( [ statusCode ] ) => statusCode . startsWith ( '2' ) ) ) {
361+ ) . filter ( ( [ s ] ) => s . startsWith ( '2' ) ) ) {
362362 // early out if response is 204
363363 // if (statusCode === '204') {
364364 // func.setReturnType('Promise<void>');
@@ -427,7 +427,7 @@ export async function processOpenApiDocument(
427427 name : 'req' ,
428428 initializer : Writers . object ( {
429429 method : Writers . assertion ( ( w ) => w . quote ( method ) , 'const' ) ,
430- pathname : `\`${ path . replaceAll ( / \ {/ g, '${' ) } \`` ,
430+ pathname : `\`${ path . replaceAll ( / { / g, '${' ) } \`` ,
431431 ...( queryType &&
432432 paramsParam && {
433433 query : `${ paramsParam . getName ( ) } ?.query` ,
Original file line number Diff line number Diff line change @@ -107,12 +107,12 @@ export function schemaToType(
107107 // WARN: Duplicated code - recursion beat me
108108 type : Writers . objectType ( {
109109 properties : Object . entries ( schemaObject . properties || { } ) . map (
110- ( [ propertyName , propertySchema ] ) => {
110+ ( [ schemaPropertyName , schemaPropertySchema ] ) => {
111111 const type = schemaToType (
112112 typesAndInterfaces ,
113113 schemaObject ,
114- propertyName ,
115- propertySchema ,
114+ schemaPropertyName ,
115+ schemaPropertySchema ,
116116 ) ;
117117
118118 return type ;
Original file line number Diff line number Diff line change 1- module . exports = require ( '@block65/eslint-config/prettier' ) ;
1+ module . exports = require ( '@block65/eslint-config/prettier.config.js ' ) ;
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ export async function build(
6666 const results = await eslint
6767 . lintFiles ( [ entryFile . getFilePath ( ) , typesFile . getFilePath ( ) ] )
6868 . catch ( ( err ) => {
69+ // eslint-disable-next-line no-console
6970 console . error ( err ) ;
7071 return [ ] ;
7172 } ) ;
You can’t perform that action at this time.
0 commit comments