Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
16 changes: 9 additions & 7 deletions test/rules/resolutions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'] : []
);

Expand All @@ -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'] : []
);

Expand All @@ -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' : ''
);

Expand All @@ -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' : ''
);

Expand All @@ -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: {},
Expand All @@ -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'] : []
);

Expand Down
6 changes: 3 additions & 3 deletions test/utils/get-dependencies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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']
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"moduleDetection": "force",
"moduleResolution": "node",
"moduleResolution": "bundler",
"module": "esnext",
"target": "esnext",
"noEmit": true,
"noImplicitAny": true,
"noUncheckedIndexedAccess": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true
"strict": true,
"types": ["bun"]
},
"exclude": ["dist"]
}