Skip to content

Commit 0901a76

Browse files
Merge pull request #1256 from opencomponents/noUnusedParameters-noImplicitReturns
[INTERNAL] enable noUnusedParameters and noImplicitReturns rules. fix problems
2 parents 0443a7a + e837ad6 commit 0901a76

21 files changed

+36
-34
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/cli/domain/mock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function mock() {
88
params: { targetType: string; targetValue: string; targetName: string },
99
callback: (err: Error) => void
1010
): void {
11-
fs.readJson(settings.configFile.src, (err, localConfig) => {
11+
fs.readJson(settings.configFile.src, (_err, localConfig) => {
1212
localConfig = localConfig || {};
1313

1414
const mockType = params.targetType + 's';

src/cli/facade/publish.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ const publish =
4949

5050
logger.warn(strings.messages.cli.ENTER_USERNAME);
5151

52-
read({}, (err, username) => {
52+
read({}, (_err, username) => {
5353
logger.warn(strings.messages.cli.ENTER_PASSWORD);
5454

55-
read({ silent: true }, (err, password) => {
55+
read({ silent: true }, (_err, password) => {
5656
cb(null, { username, password });
5757
});
5858
});
@@ -110,7 +110,7 @@ const publish =
110110

111111
logger.warn(strings.messages.cli.REGISTRY_CREDENTIALS_REQUIRED);
112112

113-
return getCredentials((err, credentials) => {
113+
return getCredentials((_err, credentials) => {
114114
putComponentToRegistry(_.extend(options, credentials), cb);
115115
});
116116
} else if ((err as any).code === 'cli_version_not_valid') {

src/cli/facade/registry-ls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Logger } from '../logger';
44

55
const registryLs =
66
({ registry, logger }: { logger: Logger; registry: RegistryCli }) =>
7-
(opts: unknown, callback: Callback<string[], string>): void => {
7+
(_opts: unknown, callback: Callback<string[], string>): void => {
88
registry.get((err, registries) => {
99
if (err) {
1010
logger.err(strings.errors.generic(err));

src/cli/facade/registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const registry =
22
() =>
3-
(opts: unknown, callback: Callback<'ok'>): void => {
3+
(_opts: unknown, callback: Callback<'ok'>): void => {
44
callback(null, 'ok');
55
};
66

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
@@ -382,7 +382,7 @@ export default function repository(conf: Config): Repository {
382382

383383
repository.getComponentVersions(
384384
componentName,
385-
(err, componentVersions) => {
385+
(_err, componentVersions) => {
386386
if (
387387
!versionHandler.validateNewVersion(
388388
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
});

0 commit comments

Comments
 (0)