mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Replace linting configurations
The previous package was outdated, preventing us from updating TS. This one also lints YAML and JSON, and applies many more rules to the test files, explaining all the changes in this PR.
This commit is contained in:
@@ -8,6 +8,7 @@ import type { HttpRequest } from '../../../../../src/server/HttpRequest';
|
||||
import { BadRequestHttpError } from '../../../../../src/util/errors/BadRequestHttpError';
|
||||
import { UnsupportedMediaTypeHttpError } from '../../../../../src/util/errors/UnsupportedMediaTypeHttpError';
|
||||
import { guardedStreamFrom } from '../../../../../src/util/StreamUtil';
|
||||
|
||||
const { defaultGraph, literal, namedNode, quad, variable } = DataFactory;
|
||||
|
||||
describe('An N3PatchBodyParser', (): void => {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { BadRequestHttpError } from '../../../../../src/util/errors/BadRequestHt
|
||||
import { UnsupportedMediaTypeHttpError } from '../../../../../src/util/errors/UnsupportedMediaTypeHttpError';
|
||||
import { ContentType } from '../../../../../src/util/Header';
|
||||
import { guardedStreamFrom } from '../../../../../src/util/StreamUtil';
|
||||
|
||||
const { namedNode, quad } = DataFactory;
|
||||
|
||||
describe('A SparqlUpdateBodyParser', (): void => {
|
||||
@@ -39,6 +40,7 @@ describe('A SparqlUpdateBodyParser', (): void => {
|
||||
|
||||
it('errors when receiving an unexpected error.', async(): Promise<void> => {
|
||||
const mock = jest.spyOn(algebra, 'translate').mockImplementationOnce((): any => {
|
||||
// eslint-disable-next-line ts/no-throw-literal
|
||||
throw 'apple';
|
||||
});
|
||||
input.request = guardedStreamFrom(
|
||||
|
||||
@@ -34,7 +34,6 @@ describe('An AcceptPreferenceParser', (): void => {
|
||||
it('parses accept-datetime headers.', async(): Promise<void> => {
|
||||
request.headers = { 'accept-datetime': 'Tue, 20 Mar 2001 20:35:00 GMT' };
|
||||
await expect(preferenceParser.handle({ request }))
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
.resolves.toEqual({ datetime: { 'Tue, 20 Mar 2001 20:35:00 GMT': 1 }});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PreferenceParser } from '../../../../../src/http/input/preferences/PreferenceParser';
|
||||
import type { PreferenceParser } from '../../../../../src/http/input/preferences/PreferenceParser';
|
||||
import { UnionPreferenceParser } from '../../../../../src/http/input/preferences/UnionPreferenceParser';
|
||||
import { InternalServerError } from '../../../../../src/util/errors/InternalServerError';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user