diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..89fd678 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,6 @@ +'use strict' + +module.exports = require('neostandard')({ + ignores: require('neostandard').resolveIgnoresFromGitignore(), + ts: true +}) diff --git a/package.json b/package.json index f73aeac..5dec876 100644 --- a/package.json +++ b/package.json @@ -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" @@ -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/*" - ] } } diff --git a/types/index.d.ts b/types/index.d.ts index e5ad7b2..a802c39 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -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. @@ -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. @@ -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 }