Skip to content

Commit 3123b41

Browse files
merge master
2 parents 73136c6 + 0901a76 commit 3123b41

16 files changed

+29
-27
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const isMockValid = (
3737
};
3838

3939
const defaultRegister = (
40-
options: unknown,
41-
dependencies: unknown,
40+
_options: unknown,
41+
_dependencies: unknown,
4242
next: () => void
4343
) => {
4444
next();

src/registry/domain/options-sanitiser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function optionsSanitiser(input: Input): Config {
1313
const options = _.clone(input);
1414

1515
if (!options.publishAuth) {
16-
(options as Config).beforePublish = (req, res, next) => next();
16+
(options as Config).beforePublish = (_req, _res, next) => next();
1717
} else {
1818
(options as Config).beforePublish = auth.middleware(options.publishAuth);
1919
}

src/registry/domain/repository.ts

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

365365
fromPromise(repository.getComponentVersions)(
366366
componentName,
367-
(err, componentVersions) => {
367+
(_err, componentVersions) => {
368368
if (
369369
!versionHandler.validateNewVersion(
370370
componentVersion,

src/registry/middleware/cors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NextFunction, Request, Response } from 'express';
22

33
export default function cors(
4-
req: Request,
4+
_req: Request,
55
res: Response,
66
next: NextFunction
77
): void {

src/registry/middleware/file-uploads.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function fileUpload(
1919
},
2020
storage: multer.diskStorage({
2121
destination: res.conf.tempDir,
22-
filename: (req, file, cb) =>
22+
filename: (_req, file, cb) =>
2323
cb(null, `${normaliseFileName(file.originalname)}-${Date.now()}.tar.gz`)
2424
})
2525
});

src/registry/middleware/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const bind = (app: Express, options: Config): Express => {
2020
app.set('port', options.port);
2121
app.set('json spaces', 0);
2222

23-
app.use((req, res, next) => {
23+
app.use((_req, res, next) => {
2424
res.conf = options;
2525
next();
2626
});

src/registry/router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function create(
3131
const prefix = conf.prefix;
3232

3333
if (prefix !== '/') {
34-
app.get('/', (req, res) => res.redirect(prefix));
34+
app.get('/', (_req, res) => res.redirect(prefix));
3535
app.get(prefix.substr(0, prefix.length - 1), routes.index);
3636
}
3737

src/registry/routes/component-info.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ function componentInfo(
4444
req: Request,
4545
res: Response,
4646
component: Component
47-
) {
47+
): void {
4848
if (err) {
4949
res.errorDetails = (err as any).registryError || err;
50-
return res.status(404).json(err);
50+
res.status(404).json(err);
51+
return;
5152
}
5253

5354
const isHtmlRequest =
@@ -64,7 +65,7 @@ function componentInfo(
6465
typeof component.repository === 'string' ? component.repository : null
6566
);
6667

67-
fromPromise(isUrlDiscoverable)(href, (err, result) => {
68+
fromPromise(isUrlDiscoverable)(href, (_err, result) => {
6869
if (!result.isDiscoverable) {
6970
href = `//${req.headers.host}${res.conf.prefix}`;
7071
}

src/registry/routes/component-preview.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ function componentPreview(
1414
if (err) {
1515
res.errorDetails = err.registryError || err;
1616
res.errorCode = 'NOT_FOUND';
17-
return res.status(404).json(err);
17+
res.status(404).json(err);
18+
return;
1819
}
1920

2021
let liveReload = '';
@@ -26,7 +27,7 @@ function componentPreview(
2627
!!req.headers.accept && req.headers.accept.indexOf('text/html') >= 0;
2728

2829
if (isHtmlRequest && !!res.conf.discovery) {
29-
return res.send(
30+
res.send(
3031
previewView({
3132
component,
3233
href: res.conf.baseUrl,

src/registry/routes/components.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function components(
3434
const registryErrors = strings.errors.registry;
3535

3636
const returnError = function (message: string) {
37-
return res.status(400).json({
37+
res.status(400).json({
3838
code: registryErrors.BATCH_ROUTE_BODY_NOT_VALID_CODE,
3939
error: registryErrors.BATCH_ROUTE_BODY_NOT_VALID(message)
4040
});
@@ -51,9 +51,9 @@ export default function components(
5151
if (!_.isEmpty(components)) {
5252
const errors = _.compact(
5353
_.map(components, (component, index) => {
54-
if (!component.name) {
55-
return registryErrors.BATCH_ROUTE_COMPONENT_NAME_MISSING(index);
56-
}
54+
return !component.name
55+
? registryErrors.BATCH_ROUTE_COMPONENT_NAME_MISSING(index)
56+
: '';
5757
})
5858
);
5959

0 commit comments

Comments
 (0)