refactor: Bring lint config back to original strictness

This commit is contained in:
Joachim Van Herwegen
2023-10-30 14:32:21 +01:00
parent 7a007dc466
commit 3bb3004abb
52 changed files with 239 additions and 132 deletions

View File

@@ -485,7 +485,7 @@ describe('A FileDataAccessor', (): void => {
});
it('can delete the root container.', async(): Promise<void> => {
cache.data = { };
cache.data = {};
await expect(accessor.deleteResource({ path: `${base}` })).resolves.toBeUndefined();
expect(cache.data).toBeUndefined();
});

View File

@@ -25,7 +25,7 @@ function simplifyQuery(query: string | string[]): string {
if (Array.isArray(query)) {
query = query.join(' ');
}
return query.replace(/\n/gu, ' ').trim();
return query.replaceAll('\n', ' ').trim();
}
describe('A SparqlDataAccessor', (): void => {

View File

@@ -29,7 +29,7 @@ describe('A BaseTypedRepresentationConverter', (): void => {
});
it('can not handle input without a Content-Type.', async(): Promise<void> => {
const args: RepresentationConverterArgs = { representation: { metadata: { }}, preferences: {}} as any;
const args: RepresentationConverterArgs = { representation: { metadata: {}}, preferences: {}} as any;
const converter = new CustomTypedRepresentationConverter('*/*', 'b/b');
await expect(converter.canHandle(args)).rejects.toThrow(NotImplementedHttpError);
});

View File

@@ -55,7 +55,7 @@ describe('A ChainedConverter', (): void => {
it('needs at least 1 converter.', async(): Promise<void> => {
expect((): any => new ChainedConverter([])).toThrow('At least 1 converter is required.');
expect(new ChainedConverter([ new DummyConverter({ }, { }) ])).toBeInstanceOf(ChainedConverter);
expect(new ChainedConverter([ new DummyConverter({}, {}) ])).toBeInstanceOf(ChainedConverter);
});
it('errors if there are no content-type or preferences.', async(): Promise<void> => {
@@ -106,7 +106,7 @@ describe('A ChainedConverter', (): void => {
expect(result.metadata.contentType).toBe('b/b');
expect(result.metadata.get(POSIX.terms.size)?.value).toBe('500');
args.preferences.type = { };
args.preferences.type = {};
result = await converter.handle(args);
expect(result.metadata.contentType).toBe('b/b');
expect(result.metadata.get(POSIX.terms.size)?.value).toBe('500');

View File

@@ -43,7 +43,7 @@ describe('A RdfToQuadConverter', (): void => {
});
it('may not handle application/json to quad conversion.', async(): Promise<void> => {
await expect(converter.getOutputTypes('application/json')).resolves.toEqual({ });
await expect(converter.getOutputTypes('application/json')).resolves.toEqual({});
});
it('can handle turtle to quad conversions.', async(): Promise<void> => {

View File

@@ -39,7 +39,7 @@ describe('An RdfPatcher,', (): void => {
};
patcher.handle.mockImplementation(
async(input: RepresentationPatcherInput<RdfDatasetRepresentation>):
Promise<RdfDatasetRepresentation> => Promise.resolve(input.representation!),
Promise<RdfDatasetRepresentation> => input.representation!,
);
rdfPatcher = new RdfPatcher(patcher);