Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps-dev): replace standard with neostandard #15

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
})
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"type": "commonjs",
"types": "types/index.d.ts",
"scripts": {
"lint": "standard",
"lint:fix": "standard --fix",
"lint": "eslint",
"lint:fix": "eslint --fix",
"test:unit": "c8 --100 node --test",
"test:typescript": "tsd",
"test": "npm run lint && npm run test:unit && npm run test:typescript"
Expand Down Expand Up @@ -39,12 +39,7 @@
"devDependencies": {
"@fastify/pre-commit": "^2.1.0",
"c8": "^9.1.0",
"standard": "^17.1.0",
"neostandard": "^0.11.9",
"tsd": "^0.31.0"
},
"standard": {
"ignore": [
"types/*"
]
}
}
19 changes: 9 additions & 10 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
* @constructor
*/
declare class RefResolver {

/**
* @param {object} opts - Options for the resolver.
* @param {boolean} opts.allowEqualDuplicates - Whether to allow schemas with equal ids to be added to the resolver.
*/
constructor(opts?: { allowEqualDuplicates?: boolean });
constructor (opts?: { allowEqualDuplicates?: boolean })

/**
* Adds the given schema to the resolver.
* @param {any} schema - The schema to be added.
* @param {string} schemaId - The default schema id of the schema to be added.
*/
addSchema(schema: any, schemaId?: string): void;
addSchema (schema: any, schemaId?: string): void

/**
* Returns the schema by the given schema id and jsonPointer.
Expand All @@ -25,34 +24,34 @@ declare class RefResolver {
* @param {string} jsonPointer - The jsonPointer of the schema to be returned.
* @returns {any | null} The schema by the given schema id and jsonPointer.
*/
getSchema(schemaId: string, jsonPointer?: string): any | null;
getSchema (schemaId: string, jsonPointer?: string): any | null

/**
* Returns true if the schema by the given schema id is added to the resolver.
* @param {string} schemaId - The schema id of the schema to be checked.
* @returns {boolean} True if the schema by the given schema id is added to the resolver.
*/
hasSchema(schemaId: string): boolean;
hasSchema (schemaId: string): boolean

/**
* Returns the schema references of the schema by the given schema id.
* @param {string} schemaId - The schema id of the schema whose references are to be returned.
* @returns {Array<{ schemaId: string; jsonPointer: string }>} The schema references of the schema by the given schema id.
*/
getSchemaRefs(schemaId: string): { schemaId: string; jsonPointer: string }[];
getSchemaRefs (schemaId: string): { schemaId: string; jsonPointer: string }[]

/**
* Returns all the schema dependencies of the schema by the given schema id.
* @param {string} schemaId - The schema id of the schema whose dependencies are to be returned.
* @returns {object} The schema dependencies of the schema by the given schema id.
*/
getSchemaDependencies(schemaId: string): { [key: string]: any };
getSchemaDependencies (schemaId: string): { [key: string]: any }

/**
* Dereferences the schema by the given schema id.
* @param {string} schemaId - The schema id of the schema to be dereferenced.
*/
derefSchema(schemaId: string): void;
derefSchema (schemaId: string): void

/**
* Returns the dereferenced schema by the given schema id and jsonPointer.
Expand All @@ -62,7 +61,7 @@ declare class RefResolver {
* @param {string} jsonPointer - The jsonPointer of the schema to be returned.
* @returns {any | null} The dereferenced schema by the given schema id and jsonPointer.
*/
getDerefSchema(schemaId: string, jsonPointer?: string): any | null;
getDerefSchema (schemaId: string, jsonPointer?: string): any | null
}

export { RefResolver };
export { RefResolver }
Loading