Skip to content

Commit 087656a

Browse files
fix lint
1 parent 03d9856 commit 087656a

File tree

7 files changed

+9
-13
lines changed

7 files changed

+9
-13
lines changed

src/cli/domain/get-mocked-plugins.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ const registerDynamicMocks = (
7373
pluginMock = require(path.resolve(ocJsonLocation, source));
7474
} catch (er) {
7575
logger.err(String(er));
76-
return;
76+
return undefined;
7777
}
7878

7979
if (!isMockValid(pluginMock)) {
8080
logger.err(`├── ${pluginName} () => Error (skipping)`);
8181
logger.err(strings.errors.cli.MOCK_PLUGIN_IS_NOT_VALID);
82-
return;
82+
return undefined;
8383
}
8484

8585
const register = (pluginMock as MockedPlugin).register || defaultRegister;

src/cli/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function processCommand(
116116
return yargs;
117117
},
118118
(options) => {
119-
// @ts-ignore not callable
119+
// @ts-expect-error not callable
120120
facade(options).catch(() => {
121121
process.exit(1);
122122
});

src/registry/middleware/request-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function requestHandler(): RequestHandler {
77
return responseTime((req: Request, res: Response, time) => {
88
const data: RequestData = {
99
body: req.body,
10-
duration: Number.parseInt(String(time * 1000)),
10+
duration: Number.parseInt(String(time * 1000), 10),
1111
headers: req.headers,
1212
method: req.method,
1313
path: req.path,

src/registry/routes/components.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,15 @@ export default function components(
9898
(result) => callback(null, result)
9999
);
100100
},
101-
// @ts-ignore
102101
(_err: any, results: GetComponentResult[]) => {
103102
try {
104103
setHeaders(results, res);
105104
setCookies(results, res);
106105
res.status(200).json(results);
107106
} catch (e) {
108-
// @ts-ignore I think this will never reach (how can setHeaders throw?)
107+
// @ts-expect-error I think this will never reach (how can setHeaders throw?)
109108
if (results.code && results.error) {
110-
// @ts-ignore
109+
// @ts-expect-error
111110
res.status(500).json({ code: results.code, error: results.error });
112111
} else {
113112
res.status(500).json({

src/registry/routes/helpers/get-component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ export default function getComponent(conf: Config, repository: Repository) {
256256
component.oc.parameters
257257
);
258258
const validationResult = validator.validateComponentParameters(
259-
// @ts-ignore
260259
params,
261260
component.oc.parameters
262261
);
@@ -336,8 +335,7 @@ export default function getComponent(conf: Config, repository: Repository) {
336335
{
337336
name: component.name,
338337
version: requestedComponent.version,
339-
// @ts-ignore
340-
parameters: params
338+
parameters: params as Record<string, string>
341339
},
342340
conf.baseUrl
343341
);

src/registry/routes/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default function (repository: Repository) {
9191

9292
res.send(
9393
indexView(
94-
// @ts-ignore existing code relies on runtime merging
94+
// @ts-expect-error existing code relies on runtime merging
9595
Object.assign(baseResponse, {
9696
availableDependencies: getAvailableDependencies(
9797
res.conf.dependencies

src/registry/views/partials/layout.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ const Layout = ({ title, href, children, scripts, theme }: LayoutProps) => {
6868
src="//ghbtns.com/github-btn.html?user=opencomponents&repo=oc&type=watch&count=true"
6969
width="110"
7070
height="20"
71-
// @ts-ignore
72-
frameBorder="0"
71+
frameborder="0"
7372
/>
7473
</div>
7574
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js" />

0 commit comments

Comments
 (0)