Skip to content

Commit

Permalink
build(deps-dev): replace standard with neostandard (#106)
Browse files Browse the repository at this point in the history
* build(deps-dev): replace standard with neostandard

* chore: add eslint.config.js

* lint separately

---------

Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com>
  • Loading branch information
Fdawgs and Uzlopak authored Dec 8, 2024
1 parent 8911706 commit 3dfce4a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 25 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ jobs:
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5
with:
license-check: true
lint: true
node-versions: '["16", "18", "20", "22"]'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div align="center">

[![CI](https://github.com/fastify/fast-uri/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/fast-uri/actions/workflows/ci.yml)
[![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)

</div>

Expand Down
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
})
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"homepage": "https://github.com/fastify/fast-uri",
"scripts": {
"bench": "node benchmark.js",
"lint": "standard | snazzy",
"lint:fix": "standard --fix",
"test": "npm run lint && npm run test:unit && npm run test:typescript",
"test:ci": "npm run lint && npm run test:unit -- --coverage-report=lcovonly && npm run test:typescript",
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "npm run test:unit && npm run test:typescript",
"test:unit": "npx tape test/**/*.js",
"test:unit:dev": "npm run test:unit -- --coverage-report=html",
"test:typescript": "tsd"
Expand All @@ -30,8 +29,7 @@
"ajv": "^8.16.0",
"benchmark": "^2.1.4",
"coveralls": "^3.1.1",
"snazzy": "^9.0.0",
"standard": "^17.1.0",
"neostandard": "^0.11.9",
"tape": "^5.8.1",
"tsd": "^0.31.0",
"uri-js": "^4.4.1"
Expand Down
18 changes: 9 additions & 9 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ declare namespace fastUri {
*/
export type URIComponents = URIComponent

export function normalize(uri: string, opts?: Options): string;
export function normalize(uri: URIComponent, opts?: Options): URIComponent;
export function normalize(uri: any, opts?: Options): any;
export function normalize (uri: string, opts?: Options): string
export function normalize (uri: URIComponent, opts?: Options): URIComponent
export function normalize (uri: any, opts?: Options): any

export function resolve(baseURI: string, relativeURI: string, options?: Options): string
export function resolve (baseURI: string, relativeURI: string, options?: Options): string

export function resolveComponent(base: URIComponent, relative: URIComponent, options?: Options, skipNormalization?: boolean): URIComponent
export function resolveComponent (base: URIComponent, relative: URIComponent, options?: Options, skipNormalization?: boolean): URIComponent

export function parse(uri: string, opts?: Options): URIComponent;
export function parse (uri: string, opts?: Options): URIComponent

export function serialize(component: URIComponent, opts?: Options): string;
export function serialize (component: URIComponent, opts?: Options): string

export function equal(uriA: string, uriB: string): boolean;
export function equal (uriA: string, uriB: string): boolean

export function resolve(base: string, path: string): string;
export function resolve (base: string, path: string): string

export const fastUri: FastUri
export { fastUri as default }
Expand Down
18 changes: 9 additions & 9 deletions types/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import uri, { URIComponents, URIComponent, Options, options } from "..";
import { expectDeprecated, expectType } from "tsd";
import uri, { URIComponents, URIComponent, Options, options } from '..'
import { expectDeprecated, expectType } from 'tsd'

const parsed = uri.parse("foo");
expectType<URIComponents>(parsed);
const parsed2 = uri.parse("foo", {
domainHost: true,
scheme: 'https',
unicodeSupport: false
const parsed = uri.parse('foo')
expectType<URIComponents>(parsed)
const parsed2 = uri.parse('foo', {
domainHost: true,
scheme: 'https',
unicodeSupport: false
})
expectType<URIComponents>(parsed2);
expectType<URIComponents>(parsed2)

expectType<URIComponent>({} as URIComponents)
expectDeprecated({} as URIComponents)
Expand Down

0 comments on commit 3dfce4a

Please sign in to comment.