From abfe750d42240bd7686d4f2a82fdb3f8e78f2575 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 9 Jul 2024 11:53:56 -0400 Subject: [PATCH 1/5] feat: replace rome with biome --- benchmark/bench-cmp-branch.js | 6 ++---- benchmark/bench-thread.js | 2 -- benchmark/bench.js | 4 +--- benchmark/parse.mjs | 6 +++--- benchmark/stringify.mjs | 10 +++++----- biome.json | 25 +++++++++++++++++++++++++ lib/index.d.ts | 4 ++++ lib/internals/querystring.js | 2 +- lib/parse.js | 2 +- package.json | 12 ++++-------- rome.json | 9 --------- test/node.ts | 6 +++--- test/parse.test.ts | 6 +++--- test/stringify.test.ts | 25 ++++++++++++++----------- 14 files changed, 66 insertions(+), 53 deletions(-) create mode 100644 biome.json delete mode 100644 rome.json diff --git a/benchmark/bench-cmp-branch.js b/benchmark/bench-cmp-branch.js index b39e402..a0c5d9d 100644 --- a/benchmark/bench-cmp-branch.js +++ b/benchmark/bench-cmp-branch.js @@ -1,5 +1,3 @@ -"use strict"; - const { spawn } = require("node:child_process"); const cliSelect = require("cli-select"); @@ -56,7 +54,7 @@ function parseBenchmarksStdout(text) { results.push({ name: match[1], alignedName: match[1] + match[2], - result: parseInt(match[3].split(",").join("")), + result: Number.parseInt(match[3].split(",").join("")), }); } } @@ -90,7 +88,7 @@ function compareResults(featureBranch, mainBranch) { } } -(async function () { +(async () => { const branches = await git.branch(); const currentBranch = branches.branches[branches.current]; diff --git a/benchmark/bench-thread.js b/benchmark/bench-thread.js index a94d9c0..ce68c24 100644 --- a/benchmark/bench-thread.js +++ b/benchmark/bench-thread.js @@ -1,5 +1,3 @@ -"use strict"; - const { workerData: benchmark, parentPort } = require("node:worker_threads"); const Benchmark = require("benchmark"); diff --git a/benchmark/bench.js b/benchmark/bench.js index e0138d9..fe2af29 100644 --- a/benchmark/bench.js +++ b/benchmark/bench.js @@ -1,5 +1,3 @@ -"use strict"; - const path = require("node:path"); const { Worker } = require("node:worker_threads"); @@ -69,7 +67,7 @@ const benchmarks = [ { type: "stringify", name: "{ id: Infinity }", - input: { id: Infinity }, + input: { id: Number.POSITIVE_INFINITY }, }, { type: "stringify", diff --git a/benchmark/parse.mjs b/benchmark/parse.mjs index d5c2113..436b632 100644 --- a/benchmark/parse.mjs +++ b/benchmark/parse.mjs @@ -1,11 +1,11 @@ +import native from "node:querystring"; +import awsQueryStringParser from "@aws-sdk/querystring-parser"; import benchmark from "cronometro"; import qs from "qs"; -import fastQueryString from "../lib/index.js"; -import native from "node:querystring"; import queryString from "query-string"; import querystringify from "querystringify"; -import awsQueryStringParser from "@aws-sdk/querystring-parser"; import querystringparser from "querystringparser"; +import fastQueryString from "../lib/index.js"; const input = "frappucino=muffin&goat=scone&pond=moose&foo=bar&foo=baz"; diff --git a/benchmark/stringify.mjs b/benchmark/stringify.mjs index 074d4f7..39da1ae 100644 --- a/benchmark/stringify.mjs +++ b/benchmark/stringify.mjs @@ -1,13 +1,13 @@ +import native from "node:querystring"; +import awsQueryStringBuilder from "@aws-sdk/querystring-builder"; import benchmark from "cronometro"; +import httpQuerystringStringify from "http-querystring-stringify"; import qs from "qs"; -import fastQueryString from "../lib/index.js"; -import native from "node:querystring"; import queryString from "query-string"; import querystringify from "querystringify"; -import httpQuerystringStringify from "http-querystring-stringify"; -import awsQueryStringBuilder from "@aws-sdk/querystring-builder"; -import querystringparser from "querystringparser"; import querystringifyQs from "querystringify-ts"; +import querystringparser from "querystringparser"; +import fastQueryString from "../lib/index.js"; const value = { frappucino: "muffin", diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..b111ea9 --- /dev/null +++ b/biome.json @@ -0,0 +1,25 @@ +{ + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 2 + }, + "linter": { + "enabled": true, + "rules": { + "complexity": { + "all": false + }, + "style": { + "all": false + }, + "suspicious": { + "noRedundantUseStrict": "off" + } + } + }, + "organizeImports": { + "enabled": true + } +} diff --git a/lib/index.d.ts b/lib/index.d.ts index a4b37a2..6561b83 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -1,10 +1,14 @@ type FastQueryString = { + // biome-ignore lint/suspicious/noExplicitAny: This is deliberate. stringify(value: Record): string; + // biome-ignore lint/suspicious/noExplicitAny: This is deliberate. parse(value: string): Record; }; declare namespace fastQueryString { + // biome-ignore lint/suspicious/noExplicitAny: This is deliberate. export function stringify(value: Record): string; + // biome-ignore lint/suspicious/noExplicitAny: This is deliberate. export function parse(value: string): Record; const fqs: FastQueryString; diff --git a/lib/internals/querystring.js b/lib/internals/querystring.js index a947cd2..35e6fd0 100644 --- a/lib/internals/querystring.js +++ b/lib/internals/querystring.js @@ -12,7 +12,7 @@ const hexTable = Array.from( // digits // alpha (uppercase) // alpha (lowercase) -// rome-ignore format: the array should not be formatted +// biome-ignore format: the array should not be formatted const noEscape = new Int8Array([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 diff --git a/lib/parse.js b/lib/parse.js index b02233f..0e49fff 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -19,7 +19,7 @@ function parse(input) { return result; } - let inputLength = input.length; + const inputLength = input.length; let key = ""; let value = ""; let startingIndex = -1; diff --git a/package.json b/package.json index 475efaf..6d9b380 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "type": "commonjs", "types": "./lib/index.d.ts", "scripts": { - "format": "rome format . --write", - "format:ci": "rome ci .", + "format": "biome check . --write", + "format:ci": "rome check .", "test": "vitest", "test:environment:edge": "vitest --environment=edge-runtime", "test:environment:browser": "vitest --environment=jsdom", @@ -20,16 +20,13 @@ "benchmark:stringify": "node benchmark/stringify.mjs", "benchmark:import": "node benchmark/import.mjs" }, - "keywords": [ - "querystring", - "qs", - "parser" - ], + "keywords": ["querystring", "qs", "parser"], "author": "Yagiz Nizipli ", "license": "MIT", "devDependencies": { "@aws-sdk/querystring-builder": "^3.357.0", "@aws-sdk/querystring-parser": "^3.357.0", + "@biomejs/biome": "1.8.3", "@edge-runtime/vm": "^3.0.3", "@types/node": "^20.4.1", "@vitest/coverage-v8": "^0.34.1", @@ -43,7 +40,6 @@ "querystringify": "^2.2.0", "querystringify-ts": "^0.1.5", "querystringparser": "^0.1.1", - "rome": "12.1.3", "simple-git": "^3.19.1", "vitest": "^0.34.1" }, diff --git a/rome.json b/rome.json deleted file mode 100644 index c67480b..0000000 --- a/rome.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "formatter": { - "indentStyle": "space", - "indentSize": 2 - }, - "linter": { - "enabled": false - } -} diff --git a/test/node.ts b/test/node.ts index e085df5..d8a2d8a 100644 --- a/test/node.ts +++ b/test/node.ts @@ -117,7 +117,7 @@ export const qsTestCases = [ ]; export const qsWeirdObjects = [ [{ regexp: /./g }, "regexp=", { regexp: "" }], - [{ regexp: new RegExp(".", "g") }, "regexp=", { regexp: "" }], + [{ regexp: /./g }, "regexp=", { regexp: "" }], [{ fn: () => {} }, "fn=", { fn: "" }], [{ fn: new Function("") }, "fn=", { fn: "" }], [{ math: Math }, "math=", { math: "" }], @@ -127,8 +127,8 @@ export const qsWeirdObjects = [ [{ f: new Boolean(false), t: new Boolean(true) }, "f=&t=", { f: "", t: "" }], [{ f: false, t: true }, "f=false&t=true", { f: "false", t: "true" }], [{ n: null }, "n=", { n: "" }], - [{ nan: NaN }, "nan=", { nan: "" }], - [{ inf: Infinity }, "inf=", { inf: "" }], + [{ nan: Number.NaN }, "nan=", { nan: "" }], + [{ inf: Number.POSITIVE_INFINITY }, "inf=", { inf: "" }], [{ a: [], b: [] }, "", {}], [{ a: 1, b: [] }, "a=1", { a: "1" }], ]; diff --git a/test/parse.test.ts b/test/parse.test.ts index 6f3e33a..8e97d93 100644 --- a/test/parse.test.ts +++ b/test/parse.test.ts @@ -1,11 +1,11 @@ +import querystring from "querystring"; +import { assert, test } from "vitest"; import qs from "../lib"; -import { test, assert } from "vitest"; import { qsNoMungeTestCases, qsTestCases, qsWeirdObjects } from "./node"; -import querystring from "querystring"; test("should succeed on node.js tests", () => { qsWeirdObjects.forEach((t) => - assert.deepEqual(qs.parse(t[1] as string), t[2] as Record), + assert.deepEqual(qs.parse(t[1] as string), t[2] as Record), ); qsNoMungeTestCases.forEach((t) => assert.deepEqual(qs.parse(t[0]), t[1])); qsTestCases.forEach((t) => assert.deepEqual(qs.parse(t[0]), t[2])); diff --git a/test/stringify.test.ts b/test/stringify.test.ts index d1896cf..dd3980a 100644 --- a/test/stringify.test.ts +++ b/test/stringify.test.ts @@ -1,11 +1,14 @@ -import { qsNoMungeTestCases, qsTestCases, qsWeirdObjects } from "./node"; -import qs from "../lib"; -import { test, assert } from "vitest"; import querystring from "querystring"; +import { assert, test } from "vitest"; +import qs from "../lib"; +import { qsNoMungeTestCases, qsTestCases, qsWeirdObjects } from "./node"; test("should succeed on node.js tests", () => { qsWeirdObjects.forEach((t) => - assert.deepEqual(qs.stringify(t[2] as Record), t[1] as string), + assert.deepEqual( + qs.stringify(t[2] as Record), + t[1] as string, + ), ); qsNoMungeTestCases.forEach((t) => assert.deepEqual(qs.stringify(t[1]), t[0])); qsTestCases.forEach((t) => assert.deepEqual(qs.stringify(t[2]), t[1])); @@ -55,7 +58,7 @@ test("should omit objects", () => { }); test("should omit non-object inputs", () => { - assert.deepEqual(qs.stringify("hello" as any), ""); + assert.deepEqual(qs.stringify("hello" as never), ""); }); test("should handle utf16 characters", () => { @@ -89,15 +92,15 @@ test("should coerce numbers to string", () => { assert.strictEqual(qs.stringify({ foo: -0 }), "foo=0"); assert.strictEqual(qs.stringify({ foo: 3 }), "foo=3"); assert.strictEqual(qs.stringify({ foo: -72.42 }), "foo=-72.42"); - assert.strictEqual(qs.stringify({ foo: NaN }), "foo="); + assert.strictEqual(qs.stringify({ foo: Number.NaN }), "foo="); assert.strictEqual(qs.stringify({ foo: 1e21 }), "foo=1e%2B21"); - assert.strictEqual(qs.stringify({ foo: Infinity }), "foo="); + assert.strictEqual(qs.stringify({ foo: Number.POSITIVE_INFINITY }), "foo="); }); test("should return empty string on certain inputs", () => { - assert.strictEqual(qs.stringify(), ""); - assert.strictEqual(qs.stringify(0), ""); + assert.strictEqual(qs.stringify(undefined as never), ""); + assert.strictEqual(qs.stringify(0 as never), ""); assert.strictEqual(qs.stringify([]), ""); - assert.strictEqual(qs.stringify(null), ""); - assert.strictEqual(qs.stringify(true), ""); + assert.strictEqual(qs.stringify(null as never), ""); + assert.strictEqual(qs.stringify(true as never), ""); }); From cc8aeabfa7eea8f96b3ef63e14edb330d22c27fc Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 9 Jul 2024 11:54:12 -0400 Subject: [PATCH 2/5] test: remove node 16 from matrix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 556ff44..540a4a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: build: strategy: matrix: - node-version: [16, 18, 20] + node-version: [18, 20, 22] os: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} permissions: From 539cb641c24af4a5ecce51adbef9bbd6c4b85548 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 9 Jul 2024 11:57:32 -0400 Subject: [PATCH 3/5] chore: update deps --- benchmark/bench-cmp-branch.js | 129 -------------------------- benchmark/bench-thread.js | 34 ------- benchmark/bench.js | 166 ---------------------------------- package.json | 22 ++--- 4 files changed, 10 insertions(+), 341 deletions(-) delete mode 100644 benchmark/bench-cmp-branch.js delete mode 100644 benchmark/bench-thread.js delete mode 100644 benchmark/bench.js diff --git a/benchmark/bench-cmp-branch.js b/benchmark/bench-cmp-branch.js deleted file mode 100644 index a0c5d9d..0000000 --- a/benchmark/bench-cmp-branch.js +++ /dev/null @@ -1,129 +0,0 @@ -const { spawn } = require("node:child_process"); - -const cliSelect = require("cli-select"); -const simpleGit = require("simple-git"); - -const git = simpleGit(process.cwd()); - -const COMMAND = "npm run benchmark"; -const DEFAULT_BRANCH = "main"; -const PERCENT_THRESHOLD = 5; -const greyColor = "\x1b[30m"; -const redColor = "\x1b[31m"; -const greenColor = "\x1b[32m"; -const resetColor = "\x1b[0m"; - -async function selectBranchName(message, branches) { - console.log(message); - const result = await cliSelect({ - type: "list", - name: "branch", - values: branches, - }); - console.log(result.value); - return result.value; -} - -async function executeCommandOnBranch(command, branch) { - console.log(`${greyColor}Checking out "${branch}"${resetColor}`); - await git.checkout(branch); - - console.log(`${greyColor}Execute "${command}"${resetColor}`); - const childProcess = spawn(command, { stdio: "pipe", shell: true }); - - let result = ""; - childProcess.stdout.on("data", (data) => { - process.stdout.write(data.toString()); - result += data.toString(); - }); - - await new Promise((resolve) => childProcess.on("close", resolve)); - - console.log(); - - return parseBenchmarksStdout(result); -} - -function parseBenchmarksStdout(text) { - const results = []; - - const lines = text.split("\n"); - for (const line of lines) { - const match = /^(.+?)(\.*) x (.+) ops\/sec .*$/.exec(line); - if (match !== null) { - results.push({ - name: match[1], - alignedName: match[1] + match[2], - result: Number.parseInt(match[3].split(",").join("")), - }); - } - } - - return results; -} - -function compareResults(featureBranch, mainBranch) { - for (const { name, alignedName, result: mainBranchResult } of mainBranch) { - const featureBranchBenchmark = featureBranch.find( - (result) => result.name === name, - ); - if (featureBranchBenchmark) { - const featureBranchResult = featureBranchBenchmark.result; - const percent = - ((featureBranchResult - mainBranchResult) * 100) / mainBranchResult; - const roundedPercent = Math.round(percent * 100) / 100; - - const percentString = - roundedPercent > 0 ? `+${roundedPercent}%` : `${roundedPercent}%`; - const message = alignedName + percentString.padStart(7, "."); - - if (roundedPercent > PERCENT_THRESHOLD) { - console.log(`${greenColor}${message}${resetColor}`); - } else if (roundedPercent < -PERCENT_THRESHOLD) { - console.log(`${redColor}${message}${resetColor}`); - } else { - console.log(message); - } - } - } -} - -(async () => { - const branches = await git.branch(); - const currentBranch = branches.branches[branches.current]; - - let featureBranch = null; - let mainBranch = null; - - if (process.argv[2] === "--ci") { - featureBranch = currentBranch.name; - mainBranch = DEFAULT_BRANCH; - } else { - featureBranch = await selectBranchName( - "Select the branch you want to compare (feature branch):", - branches.all, - ); - mainBranch = await selectBranchName( - "Select the branch you want to compare with (main branch):", - branches.all, - ); - } - - try { - const featureBranchResult = await executeCommandOnBranch( - COMMAND, - featureBranch, - ); - const mainBranchResult = await executeCommandOnBranch(COMMAND, mainBranch); - compareResults(featureBranchResult, mainBranchResult); - } catch (error) { - console.error("Switch to origin branch due to an error", error.message); - } - - await git.checkout(currentBranch.commit); - await git.checkout(currentBranch.name); - - console.log( - `${greyColor}Back to ${currentBranch.name} ${currentBranch.commit}${resetColor}`, - ); -})(); diff --git a/benchmark/bench-thread.js b/benchmark/bench-thread.js deleted file mode 100644 index ce68c24..0000000 --- a/benchmark/bench-thread.js +++ /dev/null @@ -1,34 +0,0 @@ -const { workerData: benchmark, parentPort } = require("node:worker_threads"); - -const Benchmark = require("benchmark"); -Benchmark.options.minSamples = 100; - -const suite = Benchmark.Suite(); - -const encodeString = require("../lib/internals/querystring").encodeString; -const parse = require("../lib/parse"); -const stringify = require("../lib/stringify"); - -switch (benchmark.type) { - case "encodeString": - suite.add(`${benchmark.type}: ${benchmark.name}`, () => { - encodeString(benchmark.input); - }); - break; - case "parse": - suite.add(`${benchmark.type}: ${benchmark.name}`, () => { - parse(benchmark.input); - }); - break; - case "stringify": - suite.add(`${benchmark.type}: ${benchmark.name}`, () => { - stringify(benchmark.input); - }); - break; -} - -suite - .on("cycle", (event) => { - parentPort.postMessage(String(event.target)); - }) - .run(); diff --git a/benchmark/bench.js b/benchmark/bench.js deleted file mode 100644 index fe2af29..0000000 --- a/benchmark/bench.js +++ /dev/null @@ -1,166 +0,0 @@ -const path = require("node:path"); -const { Worker } = require("node:worker_threads"); - -const BENCH_THREAD_PATH = path.join(__dirname, "bench-thread.js"); - -const benchmarks = [ - { - type: "encodeString", - name: '""', - input: "", - }, - { - type: "encodeString", - name: '"123"', - input: "123", - }, - { - type: "encodeString", - name: '"รค"', - input: "รค", - }, - { - type: "encodeString", - name: '"๐Œ†" ', - input: "๐Œ†", - }, - { - type: "stringify", - name: "undefined", - input: undefined, - }, - { - type: "stringify", - name: "null", - input: null, - }, - { - type: "stringify", - name: "{}", - input: {}, - }, - { - type: "stringify", - name: "{ id: true }", - input: { id: true }, - }, - { - type: "stringify", - name: "{ id: false }", - input: { id: false }, - }, - { - type: "stringify", - name: "{ id: 123 }", - input: { id: 123 }, - }, - { - type: "stringify", - name: "{ id: 1e+22 }", - input: { id: 1e22 }, - }, - { - type: "stringify", - name: "{ id: 123n }", - input: { id: 123n }, - }, - { - type: "stringify", - name: "{ id: Infinity }", - input: { id: Number.POSITIVE_INFINITY }, - }, - { - type: "stringify", - name: '{ id: ["1", "3"] }', - input: { id: ["1", "3"] }, - }, - { - type: "stringify", - name: '{ id: "" }', - input: { id: "" }, - }, - { - type: "stringify", - name: '{ id: "123" }', - input: { id: "123" }, - }, - { - type: "stringify", - name: '{ id: "รค" }', - input: { id: "รค" }, - }, - { - type: "stringify", - name: '{ id: "๐Œ†" } ', - input: { id: "๐Œ†" }, - }, - { - type: "stringify", - name: '{ foo: ["1", "3"], bar: "2" }', - input: { foo: ["1", "3"], bar: "2" }, - }, - { - type: "parse", - name: "", - input: "", - }, - { - type: "parse", - name: "id=123", - input: "id=123", - }, - { - type: "parse", - name: "id=123&id=123", - input: "id=123&id=123", - }, - { - type: "parse", - name: "full%20name=Yagiz", - input: "full%20name=Yagiz", - }, - { - type: "parse", - name: "invalid%key=hello", - input: "invalid%key=hello", - }, - { - type: "parse", - name: "my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F", - input: "my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F", - }, -]; - -async function runBenchmark(benchmark) { - const worker = new Worker(BENCH_THREAD_PATH, { workerData: benchmark }); - - return new Promise((resolve, reject) => { - let result = null; - worker.on("error", reject); - worker.on("message", (benchResult) => { - result = benchResult; - }); - worker.on("exit", (code) => { - if (code === 0) { - resolve(result); - } else { - reject(new Error(`Worker stopped with exit code ${code}`)); - } - }); - }); -} - -async function runBenchmarks() { - let maxNameLength = 0; - for (const benchmark of benchmarks) { - maxNameLength = Math.max(benchmark.name.length, maxNameLength); - } - - for (const benchmark of benchmarks) { - benchmark.name = benchmark.name.padEnd(maxNameLength, " "); - const resultMessage = await runBenchmark(benchmark); - console.log(resultMessage); - } -} - -runBenchmarks(); diff --git a/package.json b/package.json index 6d9b380..9a08c6b 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,6 @@ "test:watch": "vitest --watch", "test:coverage": "vitest --coverage", "coverage": "vitest run --coverage", - "benchmark": "node benchmark/bench.js", - "benchmark:cmp-branch": "node benchmark/bench-cmp-branch.js", "benchmark:parse": "node benchmark/parse.mjs", "benchmark:stringify": "node benchmark/stringify.mjs", "benchmark:import": "node benchmark/import.mjs" @@ -24,24 +22,24 @@ "author": "Yagiz Nizipli ", "license": "MIT", "devDependencies": { - "@aws-sdk/querystring-builder": "^3.357.0", - "@aws-sdk/querystring-parser": "^3.357.0", + "@aws-sdk/querystring-builder": "^3.370.0", + "@aws-sdk/querystring-parser": "^3.370.0", "@biomejs/biome": "1.8.3", - "@edge-runtime/vm": "^3.0.3", - "@types/node": "^20.4.1", - "@vitest/coverage-v8": "^0.34.1", + "@edge-runtime/vm": "^4.0.0", + "@types/node": "^20.14.10", + "@vitest/coverage-v8": "^2.0.1", "benchmark": "^2.1.4", "cli-select": "^1.1.2", - "cronometro": "^2.0.0", + "cronometro": "^3.0.2", "http-querystring-stringify": "^2.1.0", - "jsdom": "^24.0.0", - "qs": "^6.11.2", + "jsdom": "^24.1.0", + "qs": "^6.12.3", "query-string": "^9.0.0", "querystringify": "^2.2.0", "querystringify-ts": "^0.1.5", "querystringparser": "^0.1.1", - "simple-git": "^3.19.1", - "vitest": "^0.34.1" + "simple-git": "^3.25.0", + "vitest": "^2.0.1" }, "repository": { "url": "git+https://github.com/anonrig/fast-querystring.git", From fee37b840bc4f8bbedff5143ade58e1065f7bccf Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 9 Jul 2024 11:58:57 -0400 Subject: [PATCH 4/5] build: update linter github workflow --- .github/workflows/linter.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index f59d490..705418b 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -19,15 +19,9 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Use Node.js - uses: actions/setup-node@v4 - - - name: Install dependencies - run: npm install --ignore-scripts - - - name: Linter - run: npm run format:ci + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Biome + uses: biomejs/setup-biome@v2 + - name: Run Biome + run: biome ci . From a2e97c0ab234c756292dea7b1562a0637b62389b Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 9 Jul 2024 11:59:35 -0400 Subject: [PATCH 5/5] build: remove unused format-ci command --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 9a08c6b..14deea1 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "types": "./lib/index.d.ts", "scripts": { "format": "biome check . --write", - "format:ci": "rome check .", "test": "vitest", "test:environment:edge": "vitest --environment=edge-runtime", "test:environment:browser": "vitest --environment=jsdom",