diff --git a/README.md b/README.md index ba6962d..82b50ec 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CI](https://github.com/fastify/forwarded/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/forwarded/actions/workflows/ci.yml) [![NPM version](https://img.shields.io/npm/v/@fastify/forwarded.svg?style=flat)](https://www.npmjs.com/package/@fastify/forwarded) -[![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) Parse HTTP X-Forwarded-For header. 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 8c062bf..b49fe6d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@types/node": "^22.0.0", "benchmark": "2.1.4", "c8": "^10.1.2", - "standard": "^17.1.0", + "neostandard": "^0.11.9", "tsd": "^0.31.1" }, "types": "types/index.d.ts", @@ -39,8 +39,8 @@ "scripts": { "bench": "node benchmark/index.js", "bench:combined": "node benchmark/combined.js", - "lint": "standard", - "lint:fix": "standard --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "test": "npm run test:unit && npm run test:typescript", "test:unit": "c8 --100 node --test", "test:typescript": "tsd" diff --git a/types/index.d.ts b/types/index.d.ts index ed5fb98..9413405 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,4 +1,4 @@ -import { IncomingMessage } from 'http'; +import { IncomingMessage } from 'http' type Forwarded = (req: IncomingMessage) => string[] @@ -10,5 +10,5 @@ declare namespace forwarded { /** * Get all addresses in the request used in the `X-Forwarded-For` header. */ -declare function forwarded(...params: Parameters): ReturnType +declare function forwarded (...params: Parameters): ReturnType export = forwarded diff --git a/types/index.test-d.ts b/types/index.test-d.ts index b32a097..01ffa06 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -1,8 +1,8 @@ -import { IncomingMessage } from "http"; -import { expectError, expectType } from "tsd"; -import { forwarded } from ".."; -import forwardedESM from ".."; -import * as forwardedVarImport from ".."; +import { IncomingMessage } from 'http' +import { expectError, expectType } from 'tsd' +import { forwarded } from '..' +import forwardedESM from '..' +import * as forwardedVarImport from '..' expectType(forwardedESM({} as IncomingMessage)) expectType(forwarded({} as IncomingMessage))