Skip to content

Commit 1e6d2e9

Browse files
committed
Fix ESLint issues for ts-command-line
1 parent 81cf724 commit 1e6d2e9

File tree

6 files changed

+18
-14
lines changed

6 files changed

+18
-14
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2+
require("@rushstack/eslint-config/patch-eslint6");
3+
4+
module.exports = {
5+
extends: [ "@rushstack/eslint-config" ],
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
};

libraries/ts-command-line/src/CommandLineAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export abstract class CommandLineAction extends CommandLineParameterProvider {
5656

5757
private _argumentParser: argparse.ArgumentParser | undefined;
5858

59-
constructor(options: ICommandLineActionOptions) {
59+
public constructor(options: ICommandLineActionOptions) {
6060
super();
6161

6262
if (!CommandLineAction._actionNameRegExp.test(options.actionName)) {

libraries/ts-command-line/src/CommandLineParameter.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export abstract class CommandLineParameter {
6767
public readonly environmentVariable: string | undefined;
6868

6969
/** @internal */
70-
constructor(definition: IBaseCommandLineDefinition) {
70+
public constructor(definition: IBaseCommandLineDefinition) {
7171
this.longName = definition.parameterLongName;
7272
this.shortName = definition.parameterShortName;
7373
this.description = definition.description;
@@ -173,7 +173,7 @@ export abstract class CommandLineParameterWithArgument extends CommandLineParame
173173
public readonly argumentName: string;
174174

175175
/** @internal */
176-
constructor(definition: IBaseCommandLineDefinitionWithArgument) {
176+
public constructor(definition: IBaseCommandLineDefinitionWithArgument) {
177177
super(definition);
178178

179179
if (definition.argumentName === '') {
@@ -206,7 +206,7 @@ export class CommandLineChoiceParameter extends CommandLineParameter {
206206
private _value: string | undefined = undefined;
207207

208208
/** @internal */
209-
constructor(definition: ICommandLineChoiceDefinition) {
209+
public constructor(definition: ICommandLineChoiceDefinition) {
210210
super(definition);
211211

212212
if (definition.alternatives.length < 1) {
@@ -302,7 +302,7 @@ export class CommandLineFlagParameter extends CommandLineParameter {
302302
private _value: boolean = false;
303303

304304
/** @internal */
305-
constructor(definition: ICommandLineFlagDefinition) {
305+
public constructor(definition: ICommandLineFlagDefinition) {
306306
super(definition);
307307
}
308308

@@ -371,7 +371,7 @@ export class CommandLineIntegerParameter extends CommandLineParameterWithArgumen
371371
private _value: number | undefined = undefined;
372372

373373
/** @internal */
374-
constructor(definition: ICommandLineIntegerDefinition) {
374+
public constructor(definition: ICommandLineIntegerDefinition) {
375375
super(definition);
376376
this.defaultValue = definition.defaultValue;
377377
this.validateDefaultValue(!!this.defaultValue);
@@ -460,7 +460,7 @@ export class CommandLineStringParameter extends CommandLineParameterWithArgument
460460
private _value: string | undefined = undefined;
461461

462462
/** @internal */
463-
constructor(definition: ICommandLineStringDefinition) {
463+
public constructor(definition: ICommandLineStringDefinition) {
464464
super(definition);
465465

466466
this.defaultValue = definition.defaultValue;
@@ -547,7 +547,7 @@ export class CommandLineStringListParameter extends CommandLineParameterWithArgu
547547
private _values: string[] = [];
548548

549549
/** @internal */
550-
constructor(definition: ICommandLineStringListDefinition) {
550+
public constructor(definition: ICommandLineStringListDefinition) {
551551
super(definition);
552552
}
553553

libraries/ts-command-line/src/CommandLineParameterProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export abstract class CommandLineParameterProvider {
4444

4545
/** @internal */
4646
// Third party code should not inherit subclasses or call this constructor
47-
constructor() {
47+
public constructor() {
4848
this._parameters = [];
4949
this._parametersByLongName = new Map<string, CommandLineParameter>();
5050
}

libraries/ts-command-line/src/CommandLineParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface ICommandLineParserOptions {
2626
export class CommandLineParserExitError extends Error {
2727
public readonly exitCode: number;
2828

29-
constructor(exitCode: number, message: string) {
29+
public constructor(exitCode: number, message: string) {
3030
super(message);
3131

3232
// Manually set the prototype, as we can no longer extend built-in classes like Error, Array, Map, etc
@@ -86,7 +86,7 @@ export abstract class CommandLineParser extends CommandLineParameterProvider {
8686
private _actionsByName: Map<string, CommandLineAction>;
8787
private _executed: boolean = false;
8888

89-
constructor(options: ICommandLineParserOptions) {
89+
public constructor(options: ICommandLineParserOptions) {
9090
super();
9191

9292
this._options = options;

libraries/ts-command-line/tslint.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)