From de0cfd2792caf78e0b845b19f1005542a668ef53 Mon Sep 17 00:00:00 2001 From: Rebecca Stevens Date: Tue, 26 Nov 2024 17:12:46 +1300 Subject: [PATCH] build: remove semver dev dependency --- package.json | 2 -- pnpm-lock.yaml | 6 ------ src/types/utilities.test.ts | 4 ++-- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index ed97ce38..c0f45447 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,6 @@ "@phenomnomnominal/tsquery": "^6.1.3", "@release-it/conventional-changelog": "^9.0.0", "@types/eslint": "^8.56.5", - "@types/semver": "^7.5.8", "@typescript-eslint/eslint-plugin": "^7.3.1", "@typescript-eslint/parser": "^8.0.0", "@typescript/vfs": "^1.5.0", @@ -82,7 +81,6 @@ "prettier-plugin-curly": "^0.3.0", "prettier-plugin-packagejson": "^2.4.7", "release-it": "^17.0.1", - "semver": "^7.6.2", "sentences-per-line": "^0.2.1", "should-semantic-release": "^0.3.0", "tsup": "^8.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bd311fb6..0b89812a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,9 +14,6 @@ devDependencies: '@types/eslint': specifier: ^8.56.5 version: 8.56.12 - '@types/semver': - specifier: ^7.5.8 - version: 7.5.8 '@typescript-eslint/eslint-plugin': specifier: ^7.3.1 version: 7.18.0(@typescript-eslint/parser@8.15.0)(eslint@8.57.1)(typescript@5.4.5) @@ -101,9 +98,6 @@ devDependencies: release-it: specifier: ^17.0.1 version: 17.10.0(typescript@5.4.5) - semver: - specifier: ^7.6.2 - version: 7.6.3 sentences-per-line: specifier: ^0.2.1 version: 0.2.1 diff --git a/src/types/utilities.test.ts b/src/types/utilities.test.ts index 80c6c3fc..6f7c69e4 100644 --- a/src/types/utilities.test.ts +++ b/src/types/utilities.test.ts @@ -1,8 +1,8 @@ -import semver from "semver"; import ts from "typescript"; import { describe, expect, it } from "vitest"; import { createSourceFileAndTypeChecker } from "../test/utils"; +import { isTsVersionAtLeast } from "../utils"; import { isFalsyType, isPropertyReadonlyInType, @@ -133,7 +133,7 @@ describe("symbolHasReadonlyDeclaration", () => { expect(symbolHasReadonlyDeclaration(symbol, typeChecker)).toBe(expected); }); - if (semver.gte(ts.version, "5.0.0")) { + if (isTsVersionAtLeast(5, 0)) { it("returns true when the symbol belongs to a property of a nested object literal directly passed into a function that declares the parameter with a const type parameter", () => { const { sourceFile, typeChecker } = createSourceFileAndTypeChecker(` declare const fn: (param: A) => unknown;