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:
Joachim Van Herwegen
2023-10-27 11:28:57 +02:00
parent 58daeb684f
commit 6248ed0938
327 changed files with 6424 additions and 3375 deletions

View File

@@ -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 => {

View File

@@ -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(

View File

@@ -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 }});
});

View File

@@ -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';