Skip to content

Commit 4317658

Browse files
chore: update dependency typescript to v4.4.2
Co-authored-by: Ade Attwood <[email protected]>
1 parent 3942f04 commit 4317658

File tree

7 files changed

+27
-12
lines changed

7 files changed

+27
-12
lines changed

@commitlint/cli/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"devDependencies": {
3939
"@commitlint/test": "^13.0.0",
4040
"@commitlint/utils": "^13.0.0",
41+
"@types/node": "12.20.21",
4142
"@types/yargs": "^17.0.0",
4243
"execa": "^5.0.0",
4344
"fs-extra": "^10.0.0"

@commitlint/lint/src/lint.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export default async function lint(
110110
);
111111
}
112112

113-
if (config.length !== 2 && config.length !== 3) {
113+
if (config.length < 2 || config.length > 3) {
114114
return new Error(
115115
`config for rule ${name} must be 2 or 3 items long, received ${util.inspect(
116116
config

@commitlint/load/src/utils/load-plugin.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ export default function loadPlugin(
2828
try {
2929
// Check whether the plugin exists
3030
require.resolve(longName);
31-
} catch (error) {
31+
} catch (error: any) {
3232
// If the plugin can't be resolved, display the missing plugin error (usually a config or install error)
3333
console.error(chalk.red(`Failed to load plugin ${longName}.`));
3434

35-
throw new MissingPluginError(pluginName, error.message, {
35+
const message = error?.message || 'Unknown error occurred';
36+
throw new MissingPluginError(pluginName, message, {
3637
pluginName: longName,
3738
commitlintPath: path.resolve(__dirname, '../..'),
3839
});

@commitlint/travis-cli/src/cli.test.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,17 @@ const validBaseEnv = {
2121
const cli = async (config: execa.Options = {}, args: string[] = []) => {
2222
try {
2323
return await execa(bin, args, config);
24-
} catch (err) {
25-
throw new Error([err.stdout, err.stderr].join('\n'));
24+
} catch (err: any) {
25+
if (
26+
typeof err.stdout !== 'undefined' &&
27+
typeof err.stderr !== 'undefined'
28+
) {
29+
throw new Error([err.stdout, err.stderr].join('\n'));
30+
} else {
31+
throw new Error(
32+
`An unknown error occured while running '${bin} ${args.join(' ')}'`
33+
);
34+
}
2635
}
2736
};
2837

@packages/test/src/git.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ async function setup(cwd: string, gitCommand = 'git') {
3535
cwd,
3636
});
3737
await execa(gitCommand, ['config', 'commit.gpgsign', 'false'], {cwd});
38-
} catch (err) {
39-
console.warn(`git config in ${cwd} failed`, err.message);
38+
} catch (err: any) {
39+
if (typeof err === 'object' && typeof err.message === 'object') {
40+
console.warn(`git config in ${cwd} failed`, err.message);
41+
} else {
42+
console.error('An unknown error occurred setting up the git environment');
43+
}
4044
}
4145
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"lint-staged": "11.1.2",
102102
"prettier": "^2.0.5",
103103
"ts-jest": "27.0.5",
104-
"typescript": "4.3.5"
104+
"typescript": "4.4.2"
105105
},
106106
"resolutions": {
107107
"**/lodash": "^4.17.19"

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -10360,10 +10360,10 @@ typedarray@^0.0.6:
1036010360
resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
1036110361
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
1036210362

10363-
typescript@4.3.5:
10364-
version "4.3.5"
10365-
resolved "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4"
10366-
integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==
10363+
typescript@4.4.2:
10364+
version "4.4.2"
10365+
resolved "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
10366+
integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==
1036710367

1036810368
uglify-js@^3.1.4:
1036910369
version "3.7.3"

0 commit comments

Comments
 (0)