diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..38f11c6 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +registry=https://registry.npmjs.org diff --git a/bun.lock b/bun.lock index d1e174b..061ef13 100644 --- a/bun.lock +++ b/bun.lock @@ -14,7 +14,7 @@ "husky": "9.1.7", "prettier": "3.8.1", "type-fest": "5.5.0", - "typescript": "5.9.3", + "typescript": "6.0.2", "typescript-eslint": "8.58.0", }, }, @@ -232,7 +232,7 @@ "type-fest": ["type-fest@5.5.0", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-PlBfpQwiUvGViBNX84Yxwjsdhd1TUlXr6zjX7eoirtCPIr08NAmxwa+fcYBTeRQxHo9YC9wwF3m9i700sHma8g=="], - "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + "typescript": ["typescript@6.0.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ=="], "typescript-eslint": ["typescript-eslint@8.58.0", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.58.0", "@typescript-eslint/parser": "8.58.0", "@typescript-eslint/typescript-estree": "8.58.0", "@typescript-eslint/utils": "8.58.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-e2TQzKfaI85fO+F3QywtX+tCTsu/D3WW5LVU6nz8hTFKFZ8yBJ6mSYRpXqdR3mFjPWmO0eWsTa5f+UpAOe/FMA=="], diff --git a/package.json b/package.json index 0a9e60a..d0c18b9 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "husky": "9.1.7", "prettier": "3.8.1", "type-fest": "5.5.0", - "typescript": "5.9.3", + "typescript": "6.0.2", "typescript-eslint": "8.58.0" } } diff --git a/test/rules/resolutions.test.ts b/test/rules/resolutions.test.ts index 8cd7f6a..ba66e6f 100644 --- a/test/rules/resolutions.test.ts +++ b/test/rules/resolutions.test.ts @@ -60,7 +60,7 @@ describe('resolutions', () => { }); it('should fail when non-matching resolution is present in package.json and ignore list', () => { - getMultilineInputMock.mockImplementationOnce(input => + getMultilineInputMock.mockImplementationOnce((input: string) => input === 'ignore-resolutions' ? ['@test/package-foo', '@test/package-bar'] : [] ); @@ -81,7 +81,7 @@ describe('resolutions', () => { }); it('should not fail when resolutions are not present, but ignore list is', () => { - getMultilineInputMock.mockImplementationOnce(input => + getMultilineInputMock.mockImplementationOnce((input: string) => input === 'ignore-resolutions' ? ['@test/package'] : [] ); @@ -96,7 +96,7 @@ describe('resolutions', () => { describe('ignore-resolutions-until', () => { it('should not fail when some resolutions are provided and ignore-resolutions-until is set with date in the future', () => { setSystemTime(new Date('2020-12-31')); - getInputMock.mockImplementation(input => + getInputMock.mockImplementation((input: string) => input === 'ignore-resolutions-until' ? '2021-01-01' : '' ); @@ -118,7 +118,7 @@ describe('resolutions', () => { it('should fail when some resolutions are provided and ignore-resolutions-until is set with date in the past', () => { setSystemTime(new Date('2021-01-31')); - getInputMock.mockImplementation(input => + getInputMock.mockImplementation((input: string) => input === 'ignore-resolutions-until' ? '2021-01-01' : '' ); @@ -142,7 +142,9 @@ describe('resolutions', () => { it('should fail when some resolutions are provided and ignore-resolutions-until is not set', () => { setSystemTime(new Date('2021-01-31')); - getInputMock.mockImplementation(input => (input === 'ignore-resolutions-until' ? '' : '')); + getInputMock.mockImplementation((input: string) => + input === 'ignore-resolutions-until' ? '' : '' + ); const packageJson: PackageJson = { dependencies: {}, @@ -164,10 +166,10 @@ describe('resolutions', () => { it('should not fail when matching resolution is present in package.json and ignore list, while ignore-resolutions-until is provided with date in the past', () => { setSystemTime(new Date('2021-01-31')); - getInputMock.mockImplementation(input => + getInputMock.mockImplementation((input: string) => input === 'ignore-resolutions-until' ? '2021-01-01' : '' ); - getMultilineInputMock.mockImplementationOnce(input => + getMultilineInputMock.mockImplementationOnce((input: string) => input === 'ignore-resolutions' ? ['@test/package-foo', '@test/package-bar'] : [] ); diff --git a/test/utils/get-dependencies.test.ts b/test/utils/get-dependencies.test.ts index 86a4079..a9da188 100644 --- a/test/utils/get-dependencies.test.ts +++ b/test/utils/get-dependencies.test.ts @@ -38,7 +38,7 @@ describe('getDependencies', () => { }; it('should return expected result', () => { - getMultilineInputMock.mockImplementation(input => + getMultilineInputMock.mockImplementation((input: string) => input === 'dependency-types' ? ['dependencies'] : [] ); result = getDependencies(packageJson); @@ -62,7 +62,7 @@ describe('getDependencies', () => { }; it('should return expected result', () => { - getMultilineInputMock.mockImplementation(input => + getMultilineInputMock.mockImplementation((input: string) => input === 'dependency-types' ? ['dependencies', 'devDependencies'] : [] ); result = getDependencies(packageJson); @@ -102,7 +102,7 @@ describe('getDependencies', () => { }; it('should return expected result', () => { - getMultilineInputMock.mockImplementation(input => + getMultilineInputMock.mockImplementation((input: string) => input === 'dependency-types' ? ['dependencies', 'devDependencies'] : ['some-package-to-ignore'] diff --git a/tsconfig.json b/tsconfig.json index 86b28a1..cea2a0d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "moduleDetection": "force", - "moduleResolution": "node", + "moduleResolution": "bundler", "module": "esnext", "target": "esnext", "noEmit": true, @@ -10,7 +10,8 @@ "noUncheckedIndexedAccess": true, "resolveJsonModule": true, "skipLibCheck": true, - "strict": true + "strict": true, + "types": ["bun"] }, "exclude": ["dist"] }