Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchoz49 committed Dec 13, 2024
1 parent fc1b6b7 commit 663f010
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@sinclair/typebox": "^0.32.35",
"@types/node": "^20.14.12",
"eslint": "^9.7.0",
"eslint-config-standard-ext": "^1.1.0",
"eslint-config-standard-ext": "^2.2.1",
"expect-type": "^0.16.0",
"fastify": "^4.21.0",
"qs": "^6.11.2",
Expand Down
3 changes: 2 additions & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@
* }} RequestInfo
*/

import { Value } from '@sinclair/typebox/value'
import qs from 'fast-querystring'

import { Value } from '@sinclair/typebox/value'

import './formats.js'

const defaultQueryParser = value => qs.stringify(value)
Expand Down
4 changes: 3 additions & 1 deletion src/writer.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/** @typedef {import('@apidevtools/json-schema-ref-parser').JSONSchema} JSONSchema */

import SwaggerParser from '@apidevtools/json-schema-ref-parser'
import CodeBlockWriter from 'code-block-writer'
import pascalcase from 'pascalcase'
import * as prettier from 'prettier'

import SwaggerParser from '@apidevtools/json-schema-ref-parser'

import { cleanupSchema, extractSchemaOptions, kRef } from './cleanup.js'
import headTemplate from './head-template.js'
import resolver from './resolver.js'
Expand Down Expand Up @@ -277,6 +278,7 @@ export const write = async (source, opts = {}) => {
delete options.properties
delete options.required

// eslint-disable-next-line no-unused-vars, no-unreachable-loop
for (const key in properties) {
list = list.concat({ type: 'object', properties, required })
break
Expand Down
1 change: 0 additions & 1 deletion test/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-unused-vars */
declare module 'node:test' {
interface TestContext {
assert: {
Expand Down
11 changes: 6 additions & 5 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import assert from 'node:assert'
import { mkdir, readFile, writeFile } from 'node:fs/promises'
import test, { after } from 'node:test'

import fastifySwagger from '@fastify/swagger'
import { Type } from '@sinclair/typebox'
import { expectTypeOf } from 'expect-type'
import fastify from 'fastify'
import qs from 'qs'

import fastifySwagger from '@fastify/swagger'
import { Type } from '@sinclair/typebox'

import { createClient } from '../src/client.js'
import { write } from '../src/writer.js'

Expand Down Expand Up @@ -405,10 +406,10 @@ test('allOf test', async (t) => {
const { components } = await import('../tmp/test-allOf.yaml.js')
assert.deepEqual(components.schemas.AB, Type.Intersect([
Type.Object({
a: Type.Optional(Type.String())
a: Type.Optional(Type.String()),
}),
Type.Object({
b: Type.Optional(Type.String())
})
b: Type.Optional(Type.String()),
}),
]))
})

0 comments on commit 663f010

Please sign in to comment.