diff --git a/src/adaptors/in-memory-articles.ts b/src/adaptors/in-memory-articles.ts index 140384f7..82963c62 100644 --- a/src/adaptors/in-memory-articles.ts +++ b/src/adaptors/in-memory-articles.ts @@ -1,7 +1,7 @@ -import { +import type { DatasetCore, NamedNode, Quad, Quad_Object as QuadObject, } from 'rdf-js'; -import Articles from '../articles'; +import type Articles from '../articles'; import ArticleNotFound from '../errors/article-not-found'; import NotAnArticle from '../errors/not-an-article'; import { rdf, schema } from '../namespaces'; diff --git a/src/adaptors/postgres-articles.ts b/src/adaptors/postgres-articles.ts index 31504dab..6fda17b3 100644 --- a/src/adaptors/postgres-articles.ts +++ b/src/adaptors/postgres-articles.ts @@ -1,20 +1,20 @@ import ParserJsonld from '@rdfjs/parser-jsonld'; import SerializerJsonld from '@rdfjs/serializer-jsonld-ext'; -import { JsonLdObj } from 'jsonld/jsonld-spec'; +import type { JsonLdObj } from 'jsonld/jsonld-spec'; import pEvent from 'p-event'; import { errors, IBaseProtocol, IMain, ITask, } from 'pg-promise'; import { fromStream, toStream } from 'rdf-dataset-ext'; -import { +import type { DatasetCore, DatasetCoreFactory, NamedNode, Quad, Quad_Object as QuadObject, } from 'rdf-js'; import { stringToTerm, termToString } from 'rdf-string'; import toReadableStream from 'to-readable-stream'; -import Articles from '../articles'; +import type Articles from '../articles'; import ArticleNotFound from '../errors/article-not-found'; import NotAnArticle from '../errors/not-an-article'; -import { ExtendedDataFactory } from '../middleware/dataset'; +import type { ExtendedDataFactory } from '../middleware/dataset'; import { rdf, schema } from '../namespaces'; const { QueryResultError, queryResultErrorCode: { noData } } = errors; diff --git a/src/app.ts b/src/app.ts index f2f9845b..699ed5bc 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,8 +1,8 @@ import cors from '@koa/cors'; -import Router, { RouterContext } from '@koa/router'; +import type Router from '@koa/router'; import Koa, { DefaultState, Middleware } from 'koa'; import logger from 'koa-logger'; -import Articles from './articles'; +import type Articles from './articles'; import apiDocumentationLink from './middleware/api-documentation-link'; import setDataFactory from './middleware/data-factory'; import addDatasets, { DatasetContext, ExtendedDataFactory } from './middleware/dataset'; @@ -18,7 +18,7 @@ export type AppServiceContext = DatasetContext<{ articles: Articles; }>; -export type AppContext = RouterContext; +export type AppContext = Router.RouterContext; export type AppMiddleware = Middleware; diff --git a/src/articles.ts b/src/articles.ts index 4fd1e1e2..038f55ff 100644 --- a/src/articles.ts +++ b/src/articles.ts @@ -1,4 +1,4 @@ -import { DatasetCore, NamedNode } from 'rdf-js'; +import type { DatasetCore, NamedNode } from 'rdf-js'; interface Articles extends AsyncIterable<[NamedNode, DatasetCore]> { set(id: NamedNode, article: DatasetCore): Promise; diff --git a/src/data-factory.ts b/src/data-factory.ts index 5012399c..e7b0dd20 100644 --- a/src/data-factory.ts +++ b/src/data-factory.ts @@ -1,7 +1,7 @@ import dataFactory from '@rdfjs/data-model'; import createDataset from 'rdf-dataset-indexed'; -import { DatasetCore, Quad } from 'rdf-js'; -import { ExtendedDataFactory } from './middleware/dataset'; +import type { DatasetCore, Quad } from 'rdf-js'; +import type { ExtendedDataFactory } from './middleware/dataset'; const extendedDataFactory: ExtendedDataFactory = { ...dataFactory, diff --git a/src/db.ts b/src/db.ts index 6b22edaa..5d952365 100644 --- a/src/db.ts +++ b/src/db.ts @@ -1,4 +1,4 @@ -import { ConnectionConfig } from 'pg'; +import type { ConnectionConfig } from 'pg'; const config: Readonly = { user: process.env.DATABASE_USER, diff --git a/src/errors/article-not-found.ts b/src/errors/article-not-found.ts index ed39861b..d7d50e1d 100644 --- a/src/errors/article-not-found.ts +++ b/src/errors/article-not-found.ts @@ -1,4 +1,4 @@ -import { NamedNode } from 'rdf-js'; +import type { NamedNode } from 'rdf-js'; import { termToString } from 'rdf-string'; export default class ArticleNotFound extends Error { diff --git a/src/errors/not-an-article.ts b/src/errors/not-an-article.ts index fbd6de24..766f14f1 100644 --- a/src/errors/not-an-article.ts +++ b/src/errors/not-an-article.ts @@ -1,4 +1,4 @@ -import { Quad_Object as QuadObject } from 'rdf-js'; +import type { Quad_Object as QuadObject } from 'rdf-js'; import { termToString } from 'rdf-string'; import { schema } from '../namespaces'; diff --git a/src/middleware/api-documentation-link.ts b/src/middleware/api-documentation-link.ts index 4ad9930b..cd67e4a7 100644 --- a/src/middleware/api-documentation-link.ts +++ b/src/middleware/api-documentation-link.ts @@ -1,6 +1,6 @@ import formatLinkHeader from 'format-link-header'; -import { ExtendableContext, Next } from 'koa'; -import { Middleware } from 'koa-compose'; +import type { ExtendableContext, Next } from 'koa'; +import type { Middleware } from 'koa-compose'; import url from 'url'; export default (path: string): Middleware => ( diff --git a/src/middleware/data-factory.ts b/src/middleware/data-factory.ts index d7f108b1..bb4b0773 100644 --- a/src/middleware/data-factory.ts +++ b/src/middleware/data-factory.ts @@ -1,6 +1,6 @@ -import { DefaultContextExtends, Next } from 'koa'; -import { Middleware } from 'koa-compose'; -import { BaseQuad, DataFactory } from 'rdf-js'; +import type { DefaultContextExtends, Next } from 'koa'; +import type { Middleware } from 'koa-compose'; +import type { BaseQuad, DataFactory } from 'rdf-js'; export type DataFactoryContext = DataFactory> = Context & { dataFactory: Factory }; diff --git a/src/middleware/dataset.ts b/src/middleware/dataset.ts index 4de088c5..5f797593 100644 --- a/src/middleware/dataset.ts +++ b/src/middleware/dataset.ts @@ -1,11 +1,11 @@ -import { +import type { DefaultContextExtends, ExtendableContext, Next, Request, Response, } from 'koa'; -import { Middleware } from 'koa-compose'; -import { +import type { Middleware } from 'koa-compose'; +import type { BaseQuad, DataFactory, DatasetCore, DatasetCoreFactory, Quad, } from 'rdf-js'; -import { DataFactoryContext } from './data-factory'; +import type { DataFactoryContext } from './data-factory'; export type WithDataset = T & { dataset: DatasetCore }; diff --git a/src/middleware/empty-response.ts b/src/middleware/empty-response.ts index 0ed9ab55..756fcd51 100644 --- a/src/middleware/empty-response.ts +++ b/src/middleware/empty-response.ts @@ -1,5 +1,5 @@ -import { ExtendableContext, Next, Response } from 'koa'; -import { Middleware } from 'koa-compose'; +import type { ExtendableContext, Next, Response } from 'koa'; +import type { Middleware } from 'koa-compose'; const makeResponseEmpty = (response: Response): void => { response.body = ''; diff --git a/src/middleware/error-handler.ts b/src/middleware/error-handler.ts index eacf477f..88e59127 100644 --- a/src/middleware/error-handler.ts +++ b/src/middleware/error-handler.ts @@ -1,8 +1,8 @@ import createHttpError, { HttpError } from 'http-errors'; -import { ExtendableContext, Next } from 'koa'; -import { Middleware } from 'koa-compose'; +import type { ExtendableContext, Next } from 'koa'; +import type { Middleware } from 'koa-compose'; import { hydra, rdf } from '../namespaces'; -import { DatasetContext } from './dataset'; +import type { DatasetContext } from './dataset'; const handleHttpError = ( error: HttpError, diff --git a/src/middleware/jsonld.ts b/src/middleware/jsonld.ts index cca51f89..f0d86142 100644 --- a/src/middleware/jsonld.ts +++ b/src/middleware/jsonld.ts @@ -2,12 +2,12 @@ import ParserJsonld from '@rdfjs/parser-jsonld'; import SerializerJsonld from '@rdfjs/serializer-jsonld-ext'; import { format as formatContentType } from 'content-type'; import { NO_CONTENT } from 'http-status-codes'; -import { Context } from 'jsonld/jsonld-spec'; -import { Next, Response } from 'koa'; -import { Middleware } from 'koa-compose'; +import type { Context } from 'jsonld/jsonld-spec'; +import type { Next, Response } from 'koa'; +import type { Middleware } from 'koa-compose'; import pEvent from 'p-event'; import { fromStream, toStream } from 'rdf-dataset-ext'; -import { DatasetContext } from './dataset'; +import type { DatasetContext } from './dataset'; const responseHasContent = (response: Response): boolean => response.body || response.status === NO_CONTENT; diff --git a/src/middleware/routing.ts b/src/middleware/routing.ts index 6c95157c..188d6c3d 100644 --- a/src/middleware/routing.ts +++ b/src/middleware/routing.ts @@ -1,11 +1,11 @@ -import Router, { Middleware, RouterParamContext } from '@koa/router'; +import type Router from '@koa/router'; import createHttpError from 'http-errors'; -import { DefaultContextExtends, DefaultStateExtends, Next } from 'koa'; +import type { DefaultContextExtends, DefaultStateExtends, Next } from 'koa'; import compose from 'koa-compose'; const notFound = - (): Middleware => ( - async ({ _matchedRoute }: RouterParamContext, next: Next): Promise => { + (): Router.Middleware => ( + async ({ _matchedRoute }: Router.RouterParamContext, next: Next): Promise => { await next(); if (typeof _matchedRoute === 'undefined') { @@ -15,7 +15,7 @@ const notFound = -(router: Router): Middleware => ( +(router: Router): Router.Middleware => ( compose([ router.routes(), notFound(), diff --git a/src/router.ts b/src/router.ts index 9fd2b7fb..df0eabce 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,5 +1,5 @@ import Router from '@koa/router'; -import { AppServiceContext, AppState } from './app'; +import type { AppServiceContext, AppState } from './app'; import Routes from './routes'; import addArticle from './routes/add-article'; import apiDocumentation from './routes/api-documentation'; diff --git a/src/routes/add-article.ts b/src/routes/add-article.ts index 18901032..60b89e61 100644 --- a/src/routes/add-article.ts +++ b/src/routes/add-article.ts @@ -1,12 +1,12 @@ import clownface from 'clownface'; import createHttpError from 'http-errors'; import { CREATED } from 'http-status-codes'; -import { Next } from 'koa'; -import { Quad } from 'rdf-js'; +import type { Next } from 'koa'; +import type { Quad } from 'rdf-js'; import { termToString } from 'rdf-string'; import uniqueString from 'unique-string'; import url from 'url'; -import { AppContext, AppMiddleware } from '../app'; +import type { AppContext, AppMiddleware } from '../app'; import { rdf, schema } from '../namespaces'; import Routes from './index'; diff --git a/src/routes/api-documentation.ts b/src/routes/api-documentation.ts index 85ed08e7..ca4ae571 100644 --- a/src/routes/api-documentation.ts +++ b/src/routes/api-documentation.ts @@ -1,10 +1,10 @@ import clownface, { Clownface } from 'clownface'; import { CREATED, OK } from 'http-status-codes'; -import { Next } from 'koa'; -import { NamedNode } from 'rdf-js'; +import type { Next } from 'koa'; +import type { NamedNode } from 'rdf-js'; import { toRdf } from 'rdf-literal'; import url from 'url'; -import { AppContext, AppMiddleware } from '../app'; +import type { AppContext, AppMiddleware } from '../app'; import { hydra, owl, rdf, schema, } from '../namespaces'; diff --git a/src/routes/article-list.ts b/src/routes/article-list.ts index c0ef2314..a40717b2 100644 --- a/src/routes/article-list.ts +++ b/src/routes/article-list.ts @@ -1,12 +1,12 @@ import clownface, { Clownface } from 'clownface'; import { OK } from 'http-status-codes'; import all from 'it-all'; -import { Next } from 'koa'; +import type { Next } from 'koa'; import { addAll } from 'rdf-dataset-ext'; -import { DatasetCore, NamedNode } from 'rdf-js'; +import type { DatasetCore, NamedNode } from 'rdf-js'; import { toRdf } from 'rdf-literal'; import url from 'url'; -import { AppContext, AppMiddleware } from '../app'; +import type { AppContext, AppMiddleware } from '../app'; import { hydra, rdf, schema } from '../namespaces'; import Routes from './index'; diff --git a/src/routes/article.ts b/src/routes/article.ts index 34c421c5..3c5825c0 100644 --- a/src/routes/article.ts +++ b/src/routes/article.ts @@ -1,8 +1,8 @@ import createHttpError from 'http-errors'; import { OK } from 'http-status-codes'; -import { Next } from 'koa'; +import type { Next } from 'koa'; import url from 'url'; -import { AppContext, AppMiddleware } from '../app'; +import type { AppContext, AppMiddleware } from '../app'; import ArticleNotFound from '../errors/article-not-found'; export default (): AppMiddleware => ( diff --git a/src/routes/entry-point.ts b/src/routes/entry-point.ts index 01f6ea53..148f44ed 100644 --- a/src/routes/entry-point.ts +++ b/src/routes/entry-point.ts @@ -1,9 +1,9 @@ import clownface, { Clownface } from 'clownface'; import { OK } from 'http-status-codes'; -import { Next } from 'koa'; -import { NamedNode } from 'rdf-js'; +import type { Next } from 'koa'; +import type { NamedNode } from 'rdf-js'; import url from 'url'; -import { AppContext, AppMiddleware } from '../app'; +import type { AppContext, AppMiddleware } from '../app'; import { hydra, rdf, schema } from '../namespaces'; import Routes from './index'; diff --git a/test/adaptors/in-memory-articles.test.ts b/test/adaptors/in-memory-articles.test.ts index 16f18438..6a8c2b0a 100644 --- a/test/adaptors/in-memory-articles.test.ts +++ b/test/adaptors/in-memory-articles.test.ts @@ -1,7 +1,7 @@ import { literal, namedNode, quad } from '@rdfjs/data-model'; import all from 'it-all'; import 'jest-rdf'; -import { DatasetCore, NamedNode } from 'rdf-js'; +import type { DatasetCore, NamedNode } from 'rdf-js'; import InMemoryArticles from '../../src/adaptors/in-memory-articles'; import ArticleNotFound from '../../src/errors/article-not-found'; import NotAnArticle from '../../src/errors/not-an-article'; diff --git a/test/adaptors/postgres-articles.test.ts b/test/adaptors/postgres-articles.test.ts index 8342092c..99cf05cb 100644 --- a/test/adaptors/postgres-articles.test.ts +++ b/test/adaptors/postgres-articles.test.ts @@ -2,7 +2,7 @@ import { literal, namedNode, quad } from '@rdfjs/data-model'; import all from 'it-all'; import 'jest-rdf'; import pgPromise, { IBaseProtocol, IMain } from 'pg-promise'; -import { DatasetCore, NamedNode } from 'rdf-js'; +import type { DatasetCore, NamedNode } from 'rdf-js'; import PostgresArticles from '../../src/adaptors/postgres-articles'; import dataFactory from '../../src/data-factory'; import db from '../../src/db'; diff --git a/test/context.ts b/test/context.ts index 806b725c..496612c4 100644 --- a/test/context.ts +++ b/test/context.ts @@ -1,13 +1,13 @@ -import Router from '@koa/router'; -import { UnknownError } from 'http-errors'; +import type Router from '@koa/router'; +import type { UnknownError } from 'http-errors'; import Koa, { Context, Request, Response } from 'koa'; import { Request as IncomingMessage, Response as ServerResponse } from 'mock-http'; -import { DatasetCore } from 'rdf-js'; +import type { DatasetCore } from 'rdf-js'; import InMemoryArticles from '../src/adaptors/in-memory-articles'; -import { AppContext } from '../src/app'; -import Articles from '../src/articles'; +import type { AppContext } from '../src/app'; +import type Articles from '../src/articles'; import dataFactory, { dataset } from '../src/data-factory'; -import { WithDataset } from '../src/middleware/dataset'; +import type { WithDataset } from '../src/middleware/dataset'; export type ErrorListener = (error: UnknownError, context: Context) => void; diff --git a/test/create-article.ts b/test/create-article.ts index 15343f9d..9e020623 100644 --- a/test/create-article.ts +++ b/test/create-article.ts @@ -1,4 +1,4 @@ -import { +import type { DatasetCore, Literal, NamedNode, Quad_Subject as QuadSubject, } from 'rdf-js'; import { diff --git a/test/middleware.ts b/test/middleware.ts index 7924a1a3..45af925a 100644 --- a/test/middleware.ts +++ b/test/middleware.ts @@ -1,7 +1,7 @@ -import { UnknownError } from 'http-errors'; -import { ExtendableContext } from 'koa'; -import { Middleware } from 'koa-compose'; -import { AppContext } from '../src/app'; +import type { UnknownError } from 'http-errors'; +import type { ExtendableContext } from 'koa'; +import type { Middleware } from 'koa-compose'; +import type { AppContext } from '../src/app'; export type NextMiddleware = (context: CustomT) => Promise; diff --git a/test/middleware/api-documentation.test.ts b/test/middleware/api-documentation.test.ts index f5e4b17a..97598ebc 100644 --- a/test/middleware/api-documentation.test.ts +++ b/test/middleware/api-documentation.test.ts @@ -1,4 +1,4 @@ -import { Response } from 'koa'; +import type { Response } from 'koa'; import parseLinkHeader from 'parse-link-header'; import apiDocumentation from '../../src/middleware/api-documentation-link'; import createContext from '../context'; diff --git a/test/middleware/data-factory.test.ts b/test/middleware/data-factory.test.ts index 305051b5..d2dd27cd 100644 --- a/test/middleware/data-factory.test.ts +++ b/test/middleware/data-factory.test.ts @@ -1,6 +1,6 @@ import dataFactory from '@rdfjs/data-model'; -import { Next } from 'koa'; -import { DataFactory } from 'rdf-js'; +import type { Next } from 'koa'; +import type { DataFactory } from 'rdf-js'; import setDataFactory, { DataFactoryContext } from '../../src/middleware/data-factory'; import createContext from '../context'; diff --git a/test/middleware/dataset.test.ts b/test/middleware/dataset.test.ts index fe523ed1..e3a07294 100644 --- a/test/middleware/dataset.test.ts +++ b/test/middleware/dataset.test.ts @@ -1,5 +1,5 @@ import 'jest-rdf'; -import { Next } from 'koa'; +import type { Next } from 'koa'; import dataset, { DatasetContext } from '../../src/middleware/dataset'; import createContext from '../context'; diff --git a/test/middleware/empty-response.test.ts b/test/middleware/empty-response.test.ts index 1ef9e43b..1d0fa577 100644 --- a/test/middleware/empty-response.test.ts +++ b/test/middleware/empty-response.test.ts @@ -1,4 +1,4 @@ -import { Context, Response } from 'koa'; +import type { Context, Response } from 'koa'; import emptyResponse from '../../src/middleware/empty-response'; import createContext from '../context'; import runMiddleware, { NextMiddleware } from '../middleware'; diff --git a/test/middleware/error-handler.test.ts b/test/middleware/error-handler.test.ts index b1011250..74cf5e31 100644 --- a/test/middleware/error-handler.test.ts +++ b/test/middleware/error-handler.test.ts @@ -2,8 +2,8 @@ import { blankNode, literal, quad } from '@rdfjs/data-model'; import createHttpError from 'http-errors'; import { INTERNAL_SERVER_ERROR, SERVICE_UNAVAILABLE } from 'http-status-codes'; import 'jest-rdf'; -import { Response } from 'koa'; -import { WithDataset } from '../../src/middleware/dataset'; +import type { Response } from 'koa'; +import type { WithDataset } from '../../src/middleware/dataset'; import errorHandler from '../../src/middleware/error-handler'; import { hydra, rdf } from '../../src/namespaces'; import createContext, { ErrorListener } from '../context'; diff --git a/test/middleware/jsonld.test.ts b/test/middleware/jsonld.test.ts index 86e03172..eaeabe3d 100644 --- a/test/middleware/jsonld.test.ts +++ b/test/middleware/jsonld.test.ts @@ -3,14 +3,14 @@ import namespace from '@rdfjs/namespace'; import { parse as parseContentType } from 'content-type'; import { CREATED, NO_CONTENT, OK } from 'http-status-codes'; import 'jest-rdf'; -import { Context as JsonLdContext } from 'jsonld/jsonld-spec'; +import type { Context as JsonLdContext } from 'jsonld/jsonld-spec'; import { addAll } from 'rdf-dataset-ext'; -import { Quad } from 'rdf-js'; -import { AppContext } from '../../src/app'; +import type { Quad } from 'rdf-js'; +import type { AppContext } from '../../src/app'; import jsonld from '../../src/middleware/jsonld'; import { rdf, schema } from '../../src/namespaces'; import createContext, { Headers } from '../context'; -import { NextMiddleware } from '../middleware'; +import type { NextMiddleware } from '../middleware'; const makeRequest = async ( body?: string, headers?: Headers, next: NextMiddleware = jest.fn(), jsonLdContext: JsonLdContext = {}, diff --git a/test/middleware/routing.test.ts b/test/middleware/routing.test.ts index 0f98ea38..fa38e481 100644 --- a/test/middleware/routing.test.ts +++ b/test/middleware/routing.test.ts @@ -1,7 +1,7 @@ import Router from '@koa/router'; import createHttpError from 'http-errors'; import { OK } from 'http-status-codes'; -import { Context, Next, Response } from 'koa'; +import type { Context, Next, Response } from 'koa'; import routing from '../../src/middleware/routing'; import createContext from '../context'; import runMiddleware, { NextMiddleware } from '../middleware'; diff --git a/test/routes/add-article.test.ts b/test/routes/add-article.test.ts index 2152cb6a..b2862d9f 100644 --- a/test/routes/add-article.test.ts +++ b/test/routes/add-article.test.ts @@ -3,10 +3,10 @@ import createHttpError from 'http-errors'; import { CREATED } from 'http-status-codes'; import all from 'it-all'; import 'jest-rdf'; -import { Response } from 'koa'; -import { DatasetCore } from 'rdf-js'; +import type { Response } from 'koa'; +import type { DatasetCore } from 'rdf-js'; import InMemoryArticles from '../../src/adaptors/in-memory-articles'; -import Articles from '../../src/articles'; +import type Articles from '../../src/articles'; import { schema } from '../../src/namespaces'; import addArticle from '../../src/routes/add-article'; import createContext from '../context'; diff --git a/test/routes/api-documentation.test.ts b/test/routes/api-documentation.test.ts index 82d621e2..ce636c1b 100644 --- a/test/routes/api-documentation.test.ts +++ b/test/routes/api-documentation.test.ts @@ -1,8 +1,8 @@ import { namedNode, quad } from '@rdfjs/data-model'; import { OK } from 'http-status-codes'; import 'jest-rdf'; -import { Response } from 'koa'; -import { WithDataset } from '../../src/middleware/dataset'; +import type { Response } from 'koa'; +import type { WithDataset } from '../../src/middleware/dataset'; import { hydra, rdf } from '../../src/namespaces'; import apiDocumentation from '../../src/routes/api-documentation'; import createContext from '../context'; diff --git a/test/routes/article-list.test.ts b/test/routes/article-list.test.ts index 0ee02b1b..924508fd 100644 --- a/test/routes/article-list.test.ts +++ b/test/routes/article-list.test.ts @@ -1,11 +1,11 @@ import { namedNode, quad } from '@rdfjs/data-model'; import { OK } from 'http-status-codes'; import 'jest-rdf'; -import { Response } from 'koa'; +import type { Response } from 'koa'; import { toRdf } from 'rdf-literal'; import InMemoryArticles from '../../src/adaptors/in-memory-articles'; -import Articles from '../../src/articles'; -import { WithDataset } from '../../src/middleware/dataset'; +import type Articles from '../../src/articles'; +import type { WithDataset } from '../../src/middleware/dataset'; import { hydra, rdf } from '../../src/namespaces'; import articleList from '../../src/routes/article-list'; import createContext from '../context'; diff --git a/test/routes/article.test.ts b/test/routes/article.test.ts index 91de8424..d30f26d6 100644 --- a/test/routes/article.test.ts +++ b/test/routes/article.test.ts @@ -2,10 +2,10 @@ import { namedNode } from '@rdfjs/data-model'; import createHttpError from 'http-errors'; import { OK } from 'http-status-codes'; import 'jest-rdf'; -import { Response } from 'koa'; +import type { Response } from 'koa'; import InMemoryArticles from '../../src/adaptors/in-memory-articles'; -import Articles from '../../src/articles'; -import { WithDataset } from '../../src/middleware/dataset'; +import type Articles from '../../src/articles'; +import type { WithDataset } from '../../src/middleware/dataset'; import article from '../../src/routes/article'; import createContext from '../context'; import createArticle from '../create-article'; diff --git a/test/routes/entry-point.test.ts b/test/routes/entry-point.test.ts index 597db606..6b0a9b06 100644 --- a/test/routes/entry-point.test.ts +++ b/test/routes/entry-point.test.ts @@ -1,8 +1,8 @@ import { namedNode, quad } from '@rdfjs/data-model'; import { OK } from 'http-status-codes'; import 'jest-rdf'; -import { Response } from 'koa'; -import { WithDataset } from '../../src/middleware/dataset'; +import type { Response } from 'koa'; +import type { WithDataset } from '../../src/middleware/dataset'; import { hydra, rdf, schema } from '../../src/namespaces'; import entryPoint from '../../src/routes/entry-point'; import createContext from '../context'; diff --git a/tsconfig.json b/tsconfig.json index b333e1fc..91e85e5e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,8 @@ "module": "commonjs", "outDir": "build", "strict": true, - "esModuleInterop": true + "esModuleInterop": true, + "importsNotUsedAsValues": "error" }, "include": [ "src"