Skip to content

Commit 3d40a2e

Browse files
authored
Update dependencies, and fix or suppress lint issues (#1376)
1 parent 2935568 commit 3d40a2e

10 files changed

+1234
-1901
lines changed

.eslintrc.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ const javascriptSettings = {
99
'no-var': 'warn',
1010
'one-var': 'off',
1111
'space-before-function-paren': ['error', 'never'],
12-
'semi': ['error', 'always']
13-
},
14-
}
12+
semi: ['error', 'always']
13+
}
14+
};
1515

1616
const typescriptSettings = {
1717
files: ['*.ts'],
@@ -24,7 +24,9 @@ const typescriptSettings = {
2424
'no-var': 'warn',
2525
'one-var': 'off',
2626
'space-before-function-paren': ['error', 'never'],
27-
'semi': 'off',
27+
// Using method rather than property for method-signature-style, to document method overloads separately.
28+
'@typescript-eslint/method-signature-style': ['warn', 'method'],
29+
semi: 'off',
2830
'@typescript-eslint/semi': ['error', 'always'],
2931
'@typescript-eslint/member-delimiter-style': [
3032
'error',
@@ -40,7 +42,7 @@ const typescriptSettings = {
4042
}
4143
]
4244
}
43-
}
45+
};
4446

4547
module.exports = {
4648
plugins: ['jest'],
@@ -51,4 +53,4 @@ module.exports = {
5153
javascriptSettings,
5254
typescriptSettings
5355
]
54-
}
56+
};

package-lock.json

+1,204-1,878
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
],
3232
"dependencies": {},
3333
"devDependencies": {
34-
"@types/jest": "^26.0.5",
35-
"@types/node": "^14.0.23",
36-
"@typescript-eslint/eslint-plugin": "^2.34.0",
37-
"eslint": "^6.8.0",
38-
"eslint-config-standard-with-typescript": "^16.0.0",
39-
"eslint-plugin-jest": "^23.18.0",
40-
"jest": "^26.1.0",
41-
"standard": "^14.3.4",
42-
"typescript": "^3.9.7"
34+
"@types/jest": "^26.0.15",
35+
"@types/node": "^14.14.2",
36+
"@typescript-eslint/eslint-plugin": "^4.5.0",
37+
"eslint": "^7.11.0",
38+
"eslint-config-standard-with-typescript": "^19.0.1",
39+
"eslint-plugin-jest": "^24.1.0",
40+
"jest": "^26.6.0",
41+
"standard": "^15.0.0",
42+
"typescript": "^4.0.3"
4343
},
4444
"typings": "typings/index.d.ts",
4545
"jest": {

tests/command.addCommand.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ test('when commands added using .addCommand and .command then internals similar'
3636
case 'number':
3737
case 'undefined':
3838
// Compare values in a way that will be readable in test failure message.
39+
// eslint-disable-next-line jest/no-conditional-expect
3940
expect(`${key}:${cmd1[key]}`).toEqual(`${key}:${cmd2[key]}`);
4041
break;
4142
}

tests/command.executableSubcommand.lookup.test.js

+4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ test('when subcommand file missing then error', () => {
1616
return execAsync(`node ${pm} list`).catch((err) => {
1717
if (process.platform === 'win32') {
1818
// Get uncaught thrown error on Windows
19+
// eslint-disable-next-line jest/no-conditional-expect
1920
expect(err.stderr).toBeDefined();
2021
} else {
22+
// eslint-disable-next-line jest/no-conditional-expect
2123
expect(err.stderr).toMatch(new RegExp(/Error: 'pm-list' does not exist/));
2224
}
2325
});
@@ -28,8 +30,10 @@ test('when alias subcommand file missing then error', () => {
2830
return execAsync(`node ${pm} lst`).catch((err) => {
2931
if (process.platform === 'win32') {
3032
// Get uncaught thrown error on Windows
33+
// eslint-disable-next-line jest/no-conditional-expect
3134
expect(err.stderr).toBeDefined();
3235
} else {
36+
// eslint-disable-next-line jest/no-conditional-expect
3337
expect(err.stderr).toMatch(new RegExp(/Error: 'pm-list' does not exist/));
3438
}
3539
});

tests/command.executableSubcommand.signals.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const describeOrSkipOnWindows = (process.platform === 'win32') ? describe.skip :
1717
describeOrSkipOnWindows.each([['SIGINT'], ['SIGHUP'], ['SIGTERM'], ['SIGUSR1'], ['SIGUSR2']])(
1818
'test signal handling in executableSubcommand', (value) => {
1919
// Slightly tricky test, stick with callback and disable lint warning.
20-
// eslint-disable-next-line jest/no-test-callback
21-
test(`when command killed with ${value} then executableSubcommand receieves ${value}`, (done) => {
20+
// eslint-disable-next-line jest/no-done-callback
21+
test(`when command killed with ${value} then executableSubcommand receives ${value}`, (done) => {
2222
const pmPath = path.join(__dirname, './fixtures/pm');
2323

2424
// The child process writes to stdout.

tests/options.custom-processing.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ test('when option specified then callback called with value', () => {
6363
expect(mockCoercion).toHaveBeenCalledWith(value, undefined);
6464
});
6565

66-
test('when option specified then value is as returned from callback ', () => {
66+
test('when option specified then value is as returned from callback', () => {
6767
const callbackResult = 2;
6868
const program = new commander.Command();
6969
program

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
],
77
"noImplicitAny": true,
88
"noImplicitThis": true,
9-
"strictNullChecks": false,
9+
"strictNullChecks": true,
1010
"types": [
1111
"node"
1212
],
@@ -17,4 +17,4 @@
1717
"typings/index.d.ts",
1818
"typings/commander-tests.ts"
1919
]
20-
}
20+
}

typings/commander-tests.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const errorInstance = new commander.CommanderError(1, 'code', 'message');
3333

3434
// Command properties
3535
console.log(programWithOptions.someOption);
36-
// eslint-disable-next-line dot-notation
36+
// eslint-disable-next-line @typescript-eslint/dot-notation
3737
console.log(programWithOptions['someOption']);
3838
const theArgs = program.args;
3939
const theCommands: commander.Command[] = program.commands;
@@ -169,7 +169,7 @@ const { operands, unknown } = program.parseOptions(['node', 'script.js', 'hello'
169169
// opts
170170
const opts = program.opts();
171171
const optsVal1 = opts.foo;
172-
// eslint-disable-next-line dot-notation
172+
// eslint-disable-next-line @typescript-eslint/dot-notation
173173
const opstVale2 = opts['bar'];
174174

175175
// description

typings/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,6 @@ declare namespace commander {
405405
}
406406

407407
// Declaring namespace AND global
408-
// eslint-disable-next-line no-redeclare
408+
// eslint-disable-next-line @typescript-eslint/no-redeclare
409409
declare const commander: commander.CommanderStatic;
410410
export = commander;

0 commit comments

Comments
 (0)