Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update @balena/lint to v8.2.7 #107

Merged
merged 1 commit into from
Aug 5, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@balena/abstract-sql-compiler": "^9.2.0",
"@balena/lint": "^8.0.2",
"@balena/lint": "^8.2.7",
"@types/bcrypt": "^5.0.2",
"@types/chai": "^4.3.16",
"@types/chai-datetime": "^0.0.39",
Expand Down
2 changes: 1 addition & 1 deletion src/types/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const fetchProcessing: TypeUtils.FetchProcessing<Types['Read']> = (
) => {
if (data != null) {
// We append the date of the epoch so that we can parse this as a valid date.
return new Date('Thu, 01 Jan 1970 ' + data).toISOString();
return new Date(`Thu, 01 Jan 1970 ${data}`).toISOString();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this because of @typescript-eslint/restrict-plus-operands

}
return data;
};
Expand Down
2 changes: 1 addition & 1 deletion src/types/web-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const fetchProcessing: TypeUtils.FetchProcessing<Types['Read']> = (
*
*/
export const validate: TypeUtils.Validate<Types['Write'], DbWriteType> =
TypeUtils.validate.checkRequired(async (value: WebResource) => {
TypeUtils.validate.checkRequired((value: WebResource) => {
if (typeof value !== 'object') {
throw new Error(`is not an object: ${typeof value}`);
}
Expand Down
2 changes: 1 addition & 1 deletion test/Interval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import * as helpers from './helpers';
helpers.describe('Interval', (test) => {
describe('validate', function () {
test.validate(1, true, 1);
return test.validate('1', true, 1);
test.validate('1', true, 1);
});
});
2 changes: 1 addition & 1 deletion test/WebResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ helpers.describe('WebResource', (test) => {
filename: 'logo.png',
href: 'test',
};
test.validate(smallWebResourceInput, true, async (value) => {
test.validate(smallWebResourceInput, true, (value) => {
expect(typeof value).to.equal('string');
const asObj = JSON.parse(value);
expect(asObj.filename).to.equal(smallWebResourceInput.filename);
Expand Down
6 changes: 3 additions & 3 deletions test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const $describe = <T extends keyof typeof types>(
};
};

describe(typeName, () =>
describe(typeName, () => {
fn({
type,
types: {
Expand All @@ -91,8 +91,8 @@ const $describe = <T extends keyof typeof types>(
},
fetch: test('fetchProcessing' in type ? type.fetchProcessing : undefined),
validate: test(type.validate),
}),
);
});
});
};

export { $describe as describe };
Loading