diff --git a/README.md b/README.md index 5e0e49e..656185f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CI](https://github.com/fastify/fastify-throttle/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/fastify-throttle/actions/workflows/ci.yml) [![NPM version](https://img.shields.io/npm/v/@fastify/throttle.svg?style=flat)](https://www.npmjs.com/package/@fastify/throttle) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/) +[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard) Throttle the download speed of a request. 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 d986abb..badd6b1 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": "npm run test:unit && npm run test:typescript", "test:unit": "tap", "test:typescript": "tsd" @@ -32,7 +32,7 @@ "devDependencies": { "@fastify/pre-commit": "^2.1.0", "fastify": "^5.0.0", - "standard": "^17.1.0", + "neostandard": "^0.11.9", "tap": "^20.0.3", "tsd": "^0.31.1" }, diff --git a/types/index.d.ts b/types/index.d.ts index feab7cd..5b72123 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,6 +1,6 @@ import { FastifyPluginCallback, FastifyRequest, -} from 'fastify'; +} from 'fastify' declare module 'fastify' { interface FastifyContextConfig { @@ -8,7 +8,7 @@ declare module 'fastify' { } } -type FastifyThrottle = FastifyPluginCallback; +type FastifyThrottle = FastifyPluginCallback /** * Represents a function that calculates the rate of bytes per second. @@ -79,5 +79,5 @@ declare namespace fastifyThrottle { export { fastifyThrottle as default } } -declare function fastifyThrottle(...params: Parameters): ReturnType +declare function fastifyThrottle (...params: Parameters): ReturnType export = fastifyThrottle diff --git a/types/index.test-d.ts b/types/index.test-d.ts index c632a95..c252378 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -1,6 +1,6 @@ import fastify, { FastifyRequest } from 'fastify' import fastifyThrottle from '..' -import { expectType } from 'tsd'; +import { expectType } from 'tsd' const server = fastify()