mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Update eslint related dependencies
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import fs, { promises as fsPromises, Stats, WriteStream } from 'fs';
|
||||
import type { Stats, WriteStream } from 'fs';
|
||||
import fs, { promises as fsPromises } from 'fs';
|
||||
import { posix } from 'path';
|
||||
import { Readable } from 'stream';
|
||||
import { literal, namedNode, quad as quadRDF } from '@rdfjs/data-model';
|
||||
import arrayifyStream from 'arrayify-stream';
|
||||
import { DataFactory } from 'n3';
|
||||
import streamifyArray from 'streamify-array';
|
||||
import { Representation } from '../../../src/ldp/representation/Representation';
|
||||
import type { Representation } from '../../../src/ldp/representation/Representation';
|
||||
import { RepresentationMetadata } from '../../../src/ldp/representation/RepresentationMetadata';
|
||||
import { ExtensionBasedMapper } from '../../../src/storage/ExtensionBasedMapper';
|
||||
import { FileResourceStore } from '../../../src/storage/FileResourceStore';
|
||||
@@ -60,8 +61,8 @@ describe('A FileResourceStore', (): void => {
|
||||
};
|
||||
|
||||
stats = {
|
||||
isDirectory: jest.fn((): any => false) as Function,
|
||||
isFile: jest.fn((): any => false) as Function,
|
||||
isDirectory: jest.fn((): any => false) as any,
|
||||
isFile: jest.fn((): any => false) as any,
|
||||
mtime: new Date(),
|
||||
size: 5,
|
||||
} as jest.Mocked<Stats>;
|
||||
@@ -72,11 +73,11 @@ describe('A FileResourceStore', (): void => {
|
||||
func();
|
||||
}
|
||||
return writeStream;
|
||||
}) as Function,
|
||||
once: jest.fn((): any => writeStream) as Function,
|
||||
emit: jest.fn((): any => true) as Function,
|
||||
write: jest.fn((): any => true) as Function,
|
||||
end: jest.fn() as Function,
|
||||
}) as any,
|
||||
once: jest.fn((): any => writeStream) as any,
|
||||
emit: jest.fn((): any => true) as any,
|
||||
write: jest.fn((): any => true) as any,
|
||||
end: jest.fn() as any,
|
||||
} as jest.Mocked<WriteStream>;
|
||||
(fs.createWriteStream as jest.Mock).mockReturnValue(writeStream);
|
||||
|
||||
@@ -86,8 +87,8 @@ describe('A FileResourceStore', (): void => {
|
||||
func();
|
||||
}
|
||||
return readableMock;
|
||||
}) as Function,
|
||||
pipe: jest.fn((): any => readableMock) as Function,
|
||||
}) as any,
|
||||
pipe: jest.fn((): any => readableMock) as any,
|
||||
} as jest.Mocked<Readable>;
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Readable } from 'stream';
|
||||
import streamifyArray from 'streamify-array';
|
||||
import { Representation } from '../../../src/ldp/representation/Representation';
|
||||
import { RepresentationMetadata } from '../../../src/ldp/representation/RepresentationMetadata';
|
||||
import type { Representation } from '../../../src/ldp/representation/Representation';
|
||||
import type { RepresentationMetadata } from '../../../src/ldp/representation/RepresentationMetadata';
|
||||
import { InMemoryResourceStore } from '../../../src/storage/InMemoryResourceStore';
|
||||
import { NotFoundHttpError } from '../../../src/util/errors/NotFoundHttpError';
|
||||
import { readableToString } from '../../../src/util/Util';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { EventEmitter } from 'events';
|
||||
import type { EventEmitter } from 'events';
|
||||
import streamifyArray from 'streamify-array';
|
||||
import { Patch } from '../../../src/ldp/http/Patch';
|
||||
import { Representation } from '../../../src/ldp/representation/Representation';
|
||||
import { Lock } from '../../../src/storage/Lock';
|
||||
import type { Patch } from '../../../src/ldp/http/Patch';
|
||||
import type { Representation } from '../../../src/ldp/representation/Representation';
|
||||
import type { Lock } from '../../../src/storage/Lock';
|
||||
import { LockingResourceStore } from '../../../src/storage/LockingResourceStore';
|
||||
import { ResourceLocker } from '../../../src/storage/ResourceLocker';
|
||||
import { ResourceStore } from '../../../src/storage/ResourceStore';
|
||||
import type { ResourceLocker } from '../../../src/storage/ResourceLocker';
|
||||
import type { ResourceStore } from '../../../src/storage/ResourceStore';
|
||||
|
||||
describe('A LockingResourceStore', (): void => {
|
||||
let store: LockingResourceStore;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Patch } from '../../../src/ldp/http/Patch';
|
||||
import { Representation } from '../../../src/ldp/representation/Representation';
|
||||
import type { Patch } from '../../../src/ldp/http/Patch';
|
||||
import type { Representation } from '../../../src/ldp/representation/Representation';
|
||||
import { PassthroughStore } from '../../../src/storage/PassthroughStore';
|
||||
import { ResourceStore } from '../../../src/storage/ResourceStore';
|
||||
import type { ResourceStore } from '../../../src/storage/ResourceStore';
|
||||
|
||||
describe('A PassthroughStore', (): void => {
|
||||
let store: PassthroughStore;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Patch } from '../../../src/ldp/http/Patch';
|
||||
import { PatchHandler } from '../../../src/storage/patch/PatchHandler';
|
||||
import type { Patch } from '../../../src/ldp/http/Patch';
|
||||
import type { PatchHandler } from '../../../src/storage/patch/PatchHandler';
|
||||
import { PatchingStore } from '../../../src/storage/PatchingStore';
|
||||
import { ResourceStore } from '../../../src/storage/ResourceStore';
|
||||
import type { ResourceStore } from '../../../src/storage/ResourceStore';
|
||||
|
||||
describe('A PatchingStore', (): void => {
|
||||
let store: PatchingStore;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { RepresentationMetadata } from '../../../src/ldp/representation/RepresentationMetadata';
|
||||
import { RepresentationConverter } from '../../../src/storage/conversion/RepresentationConverter';
|
||||
import type { RepresentationConverter } from '../../../src/storage/conversion/RepresentationConverter';
|
||||
import { RepresentationConvertingStore } from '../../../src/storage/RepresentationConvertingStore';
|
||||
import { ResourceStore } from '../../../src/storage/ResourceStore';
|
||||
import type { ResourceStore } from '../../../src/storage/ResourceStore';
|
||||
import { CONTENT_TYPE } from '../../../src/util/UriConstants';
|
||||
|
||||
describe('A RepresentationConvertingStore', (): void => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import type { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import { RepresentationMetadata } from '../../../../src/ldp/representation/RepresentationMetadata';
|
||||
import { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import type { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import { ChainedConverter } from '../../../../src/storage/conversion/ChainedConverter';
|
||||
import { checkRequest } from '../../../../src/storage/conversion/ConversionUtil';
|
||||
import { RepresentationConverterArgs } from '../../../../src/storage/conversion/RepresentationConverter';
|
||||
import type { RepresentationConverterArgs } from '../../../../src/storage/conversion/RepresentationConverter';
|
||||
import { TypedRepresentationConverter } from '../../../../src/storage/conversion/TypedRepresentationConverter';
|
||||
import { CONTENT_TYPE } from '../../../../src/util/UriConstants';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import type { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import { RepresentationMetadata } from '../../../../src/ldp/representation/RepresentationMetadata';
|
||||
import { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import { ResourceIdentifier } from '../../../../src/ldp/representation/ResourceIdentifier';
|
||||
import type { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import type { ResourceIdentifier } from '../../../../src/ldp/representation/ResourceIdentifier';
|
||||
import { checkRequest, matchingTypes } from '../../../../src/storage/conversion/ConversionUtil';
|
||||
|
||||
describe('A ConversionUtil', (): void => {
|
||||
|
||||
@@ -2,10 +2,10 @@ import { namedNode, triple } from '@rdfjs/data-model';
|
||||
import rdfSerializer from 'rdf-serialize';
|
||||
import stringifyStream from 'stream-to-string';
|
||||
import streamifyArray from 'streamify-array';
|
||||
import { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import type { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import { RepresentationMetadata } from '../../../../src/ldp/representation/RepresentationMetadata';
|
||||
import { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import { ResourceIdentifier } from '../../../../src/ldp/representation/ResourceIdentifier';
|
||||
import type { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import type { ResourceIdentifier } from '../../../../src/ldp/representation/ResourceIdentifier';
|
||||
import { QuadToRdfConverter } from '../../../../src/storage/conversion/QuadToRdfConverter';
|
||||
import { INTERNAL_QUADS } from '../../../../src/util/ContentTypes';
|
||||
import { CONTENT_TYPE } from '../../../../src/util/UriConstants';
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { namedNode, triple } from '@rdfjs/data-model';
|
||||
import arrayifyStream from 'arrayify-stream';
|
||||
import streamifyArray from 'streamify-array';
|
||||
import { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import type { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import { RepresentationMetadata } from '../../../../src/ldp/representation/RepresentationMetadata';
|
||||
import { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import { ResourceIdentifier } from '../../../../src/ldp/representation/ResourceIdentifier';
|
||||
import type { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import type { ResourceIdentifier } from '../../../../src/ldp/representation/ResourceIdentifier';
|
||||
import { QuadToTurtleConverter } from '../../../../src/storage/conversion/QuadToTurtleConverter';
|
||||
import { INTERNAL_QUADS } from '../../../../src/util/ContentTypes';
|
||||
import { CONTENT_TYPE } from '../../../../src/util/UriConstants';
|
||||
|
||||
@@ -3,10 +3,10 @@ import { namedNode, triple } from '@rdfjs/data-model';
|
||||
import arrayifyStream from 'arrayify-stream';
|
||||
import rdfParser from 'rdf-parse';
|
||||
import streamifyArray from 'streamify-array';
|
||||
import { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import type { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import { RepresentationMetadata } from '../../../../src/ldp/representation/RepresentationMetadata';
|
||||
import { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import { ResourceIdentifier } from '../../../../src/ldp/representation/ResourceIdentifier';
|
||||
import type { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import type { ResourceIdentifier } from '../../../../src/ldp/representation/ResourceIdentifier';
|
||||
import { RdfToQuadConverter } from '../../../../src/storage/conversion/RdfToQuadConverter';
|
||||
import { INTERNAL_QUADS } from '../../../../src/util/ContentTypes';
|
||||
import { UnsupportedHttpError } from '../../../../src/util/errors/UnsupportedHttpError';
|
||||
|
||||
@@ -2,10 +2,10 @@ import { Readable } from 'stream';
|
||||
import { namedNode, triple } from '@rdfjs/data-model';
|
||||
import arrayifyStream from 'arrayify-stream';
|
||||
import streamifyArray from 'streamify-array';
|
||||
import { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import type { Representation } from '../../../../src/ldp/representation/Representation';
|
||||
import { RepresentationMetadata } from '../../../../src/ldp/representation/RepresentationMetadata';
|
||||
import { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import { ResourceIdentifier } from '../../../../src/ldp/representation/ResourceIdentifier';
|
||||
import type { RepresentationPreferences } from '../../../../src/ldp/representation/RepresentationPreferences';
|
||||
import type { ResourceIdentifier } from '../../../../src/ldp/representation/ResourceIdentifier';
|
||||
import { TurtleToQuadConverter } from '../../../../src/storage/conversion/TurtleToQuadConverter';
|
||||
import { INTERNAL_QUADS } from '../../../../src/util/ContentTypes';
|
||||
import { UnsupportedHttpError } from '../../../../src/util/errors/UnsupportedHttpError';
|
||||
|
||||
@@ -3,12 +3,12 @@ import arrayifyStream from 'arrayify-stream';
|
||||
import type { Quad } from 'rdf-js';
|
||||
import { translate } from 'sparqlalgebrajs';
|
||||
import streamifyArray from 'streamify-array';
|
||||
import { SparqlUpdatePatch } from '../../../../src/ldp/http/SparqlUpdatePatch';
|
||||
import type { SparqlUpdatePatch } from '../../../../src/ldp/http/SparqlUpdatePatch';
|
||||
import { RepresentationMetadata } from '../../../../src/ldp/representation/RepresentationMetadata';
|
||||
import { Lock } from '../../../../src/storage/Lock';
|
||||
import type { Lock } from '../../../../src/storage/Lock';
|
||||
import { SparqlUpdatePatchHandler } from '../../../../src/storage/patch/SparqlUpdatePatchHandler';
|
||||
import { ResourceLocker } from '../../../../src/storage/ResourceLocker';
|
||||
import { ResourceStore } from '../../../../src/storage/ResourceStore';
|
||||
import type { ResourceLocker } from '../../../../src/storage/ResourceLocker';
|
||||
import type { ResourceStore } from '../../../../src/storage/ResourceStore';
|
||||
import { INTERNAL_QUADS } from '../../../../src/util/ContentTypes';
|
||||
import { UnsupportedHttpError } from '../../../../src/util/errors/UnsupportedHttpError';
|
||||
|
||||
@@ -84,7 +84,7 @@ describe('A SparqlUpdatePatchHandler', (): void => {
|
||||
const input = { identifier: { path: 'path' },
|
||||
patch: { algebra: {}} as SparqlUpdatePatch };
|
||||
await expect(handler.canHandle(input)).resolves.toBeUndefined();
|
||||
delete input.patch.algebra;
|
||||
delete (input.patch as any).algebra;
|
||||
await expect(handler.canHandle(input)).rejects.toThrow(UnsupportedHttpError);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user