From 5f0b27b12e6e4cc5d0d920e56435ca1f50b65dfc Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sun, 8 Dec 2024 10:43:55 +0000 Subject: [PATCH] build(deps-dev): replace standard with neostandard --- README.md | 2 +- package.json | 10 +++------- types/index.d.ts | 6 +++--- types/index.test-d.ts | 12 ++++++------ 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 67e6286..6d12949 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![CI](https://github.com/fastify/accept-negotiator/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/accept-negotiator/actions/workflows/ci.yml) [![NPM version](https://img.shields.io/npm/v/@fastify/accept-negotiator.svg?style=flat)](https://www.npmjs.com/package/@fastify/accept-negotiator) -[![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) A negotiator for the accept-headers diff --git a/package.json b/package.json index f54f348..019bf6e 100644 --- a/package.json +++ b/package.json @@ -6,16 +6,12 @@ "main": "index.js", "types": "types/index.d.ts", "scripts": { - "lint": "standard index.js test/* benchmarks/*", + "lint": "eslint", + "lint:fix": "eslint --fix", "test": "npm run test:unit && npm run test:typescript", "test:unit": "c8 --100 node --test", "test:typescript": "tsd" }, - "standard": { - "ignore": [ - "index.d.ts" - ] - }, "keywords": [ "encoding", "negotiator", @@ -37,7 +33,7 @@ "@matteo.collina/tspl": "^0.1.1", "benchmark": "2.1.4", "c8": "^10.1.2", - "standard": "17.1.2", + "neostandard": "^0.11.9", "tsd": "^0.31.0" }, "repository": { diff --git a/types/index.d.ts b/types/index.d.ts index 6fd7d98..b7ba998 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -6,12 +6,12 @@ declare namespace negotiate { export class Negotiator { constructor (options: { supportedValues: K[]; cache?: CacheStore }) - negotiate(header: string): K | null + negotiate (header: string): K | null } export const negotiate: NegotiateFn export { negotiate as default } } -declare function negotiate(header: string, supportedValues: K[]): K | null; -export = negotiate; +declare function negotiate (header: string, supportedValues: K[]): K | null +export = negotiate diff --git a/types/index.test-d.ts b/types/index.test-d.ts index 00db969..4c665d3 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -1,10 +1,10 @@ -import { expectError, expectType, expectNotAssignable} from 'tsd' +import { expectError, expectType, expectNotAssignable } from 'tsd' import { Negotiator, negotiate } from '.' -expectType(new Negotiator({supportedValues: ['test']})) -expectType(new Negotiator({supportedValues: ['test'], cache: new Map()})) -expectType<(header: string) => ('test' | null)>(new Negotiator({ supportedValues: ['test']}).negotiate) -expectError(new Negotiator({supportedValues: [1]})) +expectType(new Negotiator({ supportedValues: ['test'] })) +expectType(new Negotiator({ supportedValues: ['test'], cache: new Map() })) +expectType<(header: string) => ('test' | null)>(new Negotiator({ supportedValues: ['test'] }).negotiate) +expectError(new Negotiator({ supportedValues: [1] })) expectError(new Negotiator()) expectError(new Negotiator(null)) expectError(new Negotiator(undefined)) @@ -12,4 +12,4 @@ expectError(new Negotiator({ supportedValues: [], cache: new Map expectType<'gzip' | 'deflate' | null>(negotiate('gzip, br, deflate', ['gzip', 'deflate'])) expectNotAssignable<'gzip'>(negotiate('gzip, br, deflate', ['gzip', 'deflate'])) -expectError(negotiate<1>('gzip, br, deflate', ['gzip', 'deflate'])) \ No newline at end of file +expectError(negotiate<1>('gzip, br, deflate', ['gzip', 'deflate']))