Skip to content

Commit

Permalink
build(deps-dev): replace standard with neostandard (#258)
Browse files Browse the repository at this point in the history
* build(deps-dev): replace standard with neostandard

* chore: add eslint.config.js

* fix lint

---------

Co-authored-by: Aras Abbasi <[email protected]>
  • Loading branch information
Fdawgs and Uzlopak authored Dec 8, 2024
1 parent eee41bb commit 5afc9a7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict'

module.exports = require('neostandard')({
ignores: require('neostandard').resolveIgnoresFromGitignore(),
ts: true
})
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"url": "git+https://github.com/fastify/fluent-json-schema.git"
},
"scripts": {
"lint": "standard | snazzy",
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "npm run test:unit && npm run test:typescript",
"test:unit": "c8 --100 node --test",
"test:typescript": "tsd",
Expand All @@ -41,8 +42,7 @@
"c8": "^10.1.2",
"jsdoc-to-markdown": "^9.0.0",
"lodash.merge": "^4.6.2",
"snazzy": "^9.0.0",
"standard": "^17.1.0",
"neostandard": "^0.11.9",
"tsd": "^0.31.0"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions types/FluentJSONSchema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ export type MixedSchema<T extends TYPE[]> =
? InferSchemaMap[First] & MixedSchema<Rest>
: unknown


interface PatternPropertiesOptions {
[key: string]: JSONSchema
}
Expand All @@ -162,9 +161,9 @@ type DependentSchemaOptions<T extends Partial<Record<string, JSONSchema>>> = Par

type DependentRequiredOptions<T extends Partial<Record<string, string[]>>> = Partial<Record<keyof T, string[]>>

export function withOptions<T>(options: SchemaOptions): T
export function withOptions<T> (options: SchemaOptions): T

type ObjectPlaceholder = Record<string | number | symbol, any>;
type ObjectPlaceholder = Record<string | number | symbol, any>

export interface S extends BaseSchema<S> {
string: () => StringSchema
Expand All @@ -179,6 +178,7 @@ export interface S extends BaseSchema<S> {
FORMATS: FORMATS
}

// eslint-disable-next-line @typescript-eslint/no-redeclare, no-var
export declare var S: S

export default S
16 changes: 8 additions & 8 deletions types/FluentJSONSchema.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ const dependentSchemas = S.object()

console.log('dependentRequired:\n', JSON.stringify(dependentSchemas))

const deprecatedSchema = S.object()
.deprecated()
.prop('foo', S.string().deprecated())
.valueOf()
const deprecatedSchema = S.object()
.deprecated()
.prop('foo', S.string().deprecated())
.valueOf()

console.log('deprecatedSchema:\n', JSON.stringify(deprecatedSchema))

Expand Down Expand Up @@ -169,10 +169,10 @@ const dependentSchemasWithType = S.object<Foo>()

console.log('dependentSchemasWithType:\n', JSON.stringify(dependentSchemasWithType))

const deprecatedSchemaWithType = S.object<Foo>()
.deprecated()
.prop('foo', S.string().deprecated())
.valueOf()
const deprecatedSchemaWithType = S.object<Foo>()
.deprecated()
.prop('foo', S.string().deprecated())
.valueOf()

console.log('deprecatedSchemaWithType:\n', JSON.stringify(deprecatedSchemaWithType))

Expand Down

0 comments on commit 5afc9a7

Please sign in to comment.