Skip to content

Commit

Permalink
Update dependencies, and fix or suppress lint issues (#1376)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowspawn committed Oct 23, 2020
1 parent 2935568 commit 3d40a2e
Show file tree
Hide file tree
Showing 10 changed files with 1,234 additions and 1,901 deletions.
14 changes: 8 additions & 6 deletions .eslintrc.js
Expand Up @@ -9,9 +9,9 @@ const javascriptSettings = {
'no-var': 'warn',
'one-var': 'off',
'space-before-function-paren': ['error', 'never'],
'semi': ['error', 'always']
},
}
semi: ['error', 'always']
}
};

const typescriptSettings = {
files: ['*.ts'],
Expand All @@ -24,7 +24,9 @@ const typescriptSettings = {
'no-var': 'warn',
'one-var': 'off',
'space-before-function-paren': ['error', 'never'],
'semi': 'off',
// Using method rather than property for method-signature-style, to document method overloads separately.
'@typescript-eslint/method-signature-style': ['warn', 'method'],
semi: 'off',
'@typescript-eslint/semi': ['error', 'always'],
'@typescript-eslint/member-delimiter-style': [
'error',
Expand All @@ -40,7 +42,7 @@ const typescriptSettings = {
}
]
}
}
};

module.exports = {
plugins: ['jest'],
Expand All @@ -51,4 +53,4 @@ module.exports = {
javascriptSettings,
typescriptSettings
]
}
};
3,082 changes: 1,204 additions & 1,878 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Expand Up @@ -31,15 +31,15 @@
],
"dependencies": {},
"devDependencies": {
"@types/jest": "^26.0.5",
"@types/node": "^14.0.23",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"eslint": "^6.8.0",
"eslint-config-standard-with-typescript": "^16.0.0",
"eslint-plugin-jest": "^23.18.0",
"jest": "^26.1.0",
"standard": "^14.3.4",
"typescript": "^3.9.7"
"@types/jest": "^26.0.15",
"@types/node": "^14.14.2",
"@typescript-eslint/eslint-plugin": "^4.5.0",
"eslint": "^7.11.0",
"eslint-config-standard-with-typescript": "^19.0.1",
"eslint-plugin-jest": "^24.1.0",
"jest": "^26.6.0",
"standard": "^15.0.0",
"typescript": "^4.0.3"
},
"typings": "typings/index.d.ts",
"jest": {
Expand Down
1 change: 1 addition & 0 deletions tests/command.addCommand.test.js
Expand Up @@ -36,6 +36,7 @@ test('when commands added using .addCommand and .command then internals similar'
case 'number':
case 'undefined':
// Compare values in a way that will be readable in test failure message.
// eslint-disable-next-line jest/no-conditional-expect
expect(`${key}:${cmd1[key]}`).toEqual(`${key}:${cmd2[key]}`);
break;
}
Expand Down
4 changes: 4 additions & 0 deletions tests/command.executableSubcommand.lookup.test.js
Expand Up @@ -16,8 +16,10 @@ test('when subcommand file missing then error', () => {
return execAsync(`node ${pm} list`).catch((err) => {
if (process.platform === 'win32') {
// Get uncaught thrown error on Windows
// eslint-disable-next-line jest/no-conditional-expect
expect(err.stderr).toBeDefined();
} else {
// eslint-disable-next-line jest/no-conditional-expect
expect(err.stderr).toMatch(new RegExp(/Error: 'pm-list' does not exist/));
}
});
Expand All @@ -28,8 +30,10 @@ test('when alias subcommand file missing then error', () => {
return execAsync(`node ${pm} lst`).catch((err) => {
if (process.platform === 'win32') {
// Get uncaught thrown error on Windows
// eslint-disable-next-line jest/no-conditional-expect
expect(err.stderr).toBeDefined();
} else {
// eslint-disable-next-line jest/no-conditional-expect
expect(err.stderr).toMatch(new RegExp(/Error: 'pm-list' does not exist/));
}
});
Expand Down
4 changes: 2 additions & 2 deletions tests/command.executableSubcommand.signals.test.js
Expand Up @@ -17,8 +17,8 @@ const describeOrSkipOnWindows = (process.platform === 'win32') ? describe.skip :
describeOrSkipOnWindows.each([['SIGINT'], ['SIGHUP'], ['SIGTERM'], ['SIGUSR1'], ['SIGUSR2']])(
'test signal handling in executableSubcommand', (value) => {
// Slightly tricky test, stick with callback and disable lint warning.
// eslint-disable-next-line jest/no-test-callback
test(`when command killed with ${value} then executableSubcommand receieves ${value}`, (done) => {
// eslint-disable-next-line jest/no-done-callback
test(`when command killed with ${value} then executableSubcommand receives ${value}`, (done) => {
const pmPath = path.join(__dirname, './fixtures/pm');

// The child process writes to stdout.
Expand Down
2 changes: 1 addition & 1 deletion tests/options.custom-processing.test.js
Expand Up @@ -63,7 +63,7 @@ test('when option specified then callback called with value', () => {
expect(mockCoercion).toHaveBeenCalledWith(value, undefined);
});

test('when option specified then value is as returned from callback ', () => {
test('when option specified then value is as returned from callback', () => {
const callbackResult = 2;
const program = new commander.Command();
program
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Expand Up @@ -6,7 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"types": [
"node"
],
Expand All @@ -17,4 +17,4 @@
"typings/index.d.ts",
"typings/commander-tests.ts"
]
}
}
4 changes: 2 additions & 2 deletions typings/commander-tests.ts
Expand Up @@ -33,7 +33,7 @@ const errorInstance = new commander.CommanderError(1, 'code', 'message');

// Command properties
console.log(programWithOptions.someOption);
// eslint-disable-next-line dot-notation
// eslint-disable-next-line @typescript-eslint/dot-notation
console.log(programWithOptions['someOption']);
const theArgs = program.args;
const theCommands: commander.Command[] = program.commands;
Expand Down Expand Up @@ -169,7 +169,7 @@ const { operands, unknown } = program.parseOptions(['node', 'script.js', 'hello'
// opts
const opts = program.opts();
const optsVal1 = opts.foo;
// eslint-disable-next-line dot-notation
// eslint-disable-next-line @typescript-eslint/dot-notation
const opstVale2 = opts['bar'];

// description
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Expand Up @@ -405,6 +405,6 @@ declare namespace commander {
}

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

0 comments on commit 3d40a2e

Please sign in to comment.