mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-21 10:50:09 +00:00
chore: Code changes & formatting and linting (#3552)
* Do some code changes & run prettier and eslint
* Fix test:test-type script
* Apply code review suggestions
* update heartbeat interval & add a reason for the specific value
* Fix husky error
* Update to TS 5.5
And use ${configDir}
* Fix test.json tsconfig base
---------
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
|
||||
import fs from 'fs'
|
||||
|
||||
// TODO: replace with fetch of live spec
|
||||
const DISCORD_SPEC = {}
|
||||
|
||||
function schemaRefToName(ref) {
|
||||
if (!ref) return ""
|
||||
if (!ref) return ''
|
||||
return `Discord${ref?.substring(ref.lastIndexOf('/') + 1)}`
|
||||
}
|
||||
|
||||
@@ -60,12 +63,12 @@ function generateFromSpec() {
|
||||
type === 'integer'
|
||||
? 'number'
|
||||
: type === 'array'
|
||||
? property.items.$ref
|
||||
? `${schemaRefToName(property.items.$ref)}[]`
|
||||
: Array.isArray(property.items.oneOf)
|
||||
? `${property.items.oneOf.map((o) => `${schemaRefToName(o.$ref)}[]`).join(' | ')}`
|
||||
: `unknown[]`
|
||||
: type,
|
||||
? property.items.$ref
|
||||
? `${schemaRefToName(property.items.$ref)}[]`
|
||||
: Array.isArray(property.items.oneOf)
|
||||
? `${property.items.oneOf.map((o) => `${schemaRefToName(o.$ref)}[]`).join(' | ')}`
|
||||
: `unknown[]`
|
||||
: type,
|
||||
)
|
||||
.join(' | ') ??
|
||||
property.oneOf
|
||||
|
||||
Reference in New Issue
Block a user