Skip to content

Commit 11fcb76

Browse files
lyonsilclaude
andauthored
Fix all npm audit vulnerabilities by upgrading dependencies (#80)
@typescript-eslint/* ^6 → ^8 - Fixes minimatch ReDoS vulnerabilities copy-webpack-plugin ^12 → ^14 - Fixes serialize-javascript RCE vulnerability eslint-config-erb removed - Source of the peer dep conflicts; replaced by direct configs eslint-config-airbnb-base removed - Redundant — eslint-config-airbnb already depends on it eslint-config-airbnb added - Previously pulled in by erb eslint-config-prettier added - Previously pulled in by erb eslint-plugin-prettier added - Previously pulled in by erb @stylistic/eslint-plugin-ts ^2.13.0 added - Provides lines-between-class-members rule with exceptAfterOverload support, which was removed from @typescript-eslint v8 ESLint behavioral parity: - All rules erb explicitly set are preserved. - lines-between-class-members now uses @stylistic/ts/lines-between-class-members to preserve the original exceptAfterOverload: true option. tsconfig.lint.json change: allowJs: true only affects the lint-specific tsconfig (not builds), and is the official replacement for the removed createDefaultProgram. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bb40335 commit 11fcb76

File tree

6 files changed

+4925
-9838
lines changed

6 files changed

+4925
-9838
lines changed

.eslintrc.cjs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22

33
module.exports = {
44
extends: [
5-
// https://github.com/electron-react-boilerplate/eslint-config-erb/blob/main/index.js
6-
// airbnb rules are embedded in erb https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb
7-
'erb',
5+
// https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb
6+
'airbnb',
7+
'airbnb/hooks',
8+
'plugin:promise/recommended',
9+
'plugin:compat/recommended',
810
// https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#typescript
911
'plugin:import/recommended',
1012
'plugin:import/typescript',
1113
// Make sure this is last so it gets the chance to override other configs.
1214
// See https://github.com/prettier/eslint-config-prettier and https://github.com/prettier/eslint-plugin-prettier
1315
'plugin:prettier/recommended',
1416
],
17+
env: {
18+
browser: true,
19+
node: true,
20+
},
1521

1622
rules: {
1723
// Some rules in this following shared region are not applied since they are overridden in subsequent regions
@@ -21,6 +27,7 @@ module.exports = {
2127

2228
// Use `noImplicitReturns` instead. See https://typescript-eslint.io/rules/consistent-return/.
2329
'consistent-return': 'off',
30+
'no-param-reassign': ['error', { props: false }],
2431
'import/default': 'off',
2532
'import/extensions': 'off',
2633
// A temporary hack related to IDE not resolving correct package.json
@@ -45,7 +52,7 @@ module.exports = {
4552
],
4653
'@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
4754
'lines-between-class-members': 'off',
48-
'@typescript-eslint/lines-between-class-members': [
55+
'@stylistic/ts/lines-between-class-members': [
4956
'error',
5057
'always',
5158
{ exceptAfterSingleLine: true, exceptAfterOverload: true },
@@ -156,14 +163,14 @@ module.exports = {
156163
},
157164
},
158165
],
166+
parser: '@typescript-eslint/parser',
159167
parserOptions: {
160168
ecmaVersion: 2022,
161169
sourceType: 'module',
162170
project: './tsconfig.lint.json',
163171
tsconfigRootDir: __dirname,
164-
createDefaultProgram: true,
165172
},
166-
plugins: ['@typescript-eslint', 'no-type-assertion', 'no-null'],
173+
plugins: ['@typescript-eslint', '@stylistic/ts', 'no-type-assertion', 'no-null'],
167174
settings: {
168175
'import/resolver': {
169176
typescript: {

lib/git.util.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ export async function execCommand(
9191
});
9292
if (!quiet && result.stdout) console.log(result.stdout);
9393
if (!quiet && result.stderr) console.log(result.stderr);
94-
return result;
94+
return {
95+
stdout: result.stdout.toString(),
96+
stderr: result.stderr.toString(),
97+
};
9598
} catch (error: unknown) {
9699
if (error instanceof Error) {
97100
// Use the more specific type for `exec`.
@@ -265,7 +268,7 @@ export async function formatExtensionFolder(extensionFolderPath: string) {
265268
await fs.rename(oldTypesFilePath, newTypesFilePath);
266269
console.log(`Renamed types file to ${extensionName}.d.ts`);
267270
}
268-
} catch (error) {
271+
} catch {
269272
// Old file doesn't exist, so no need to rename
270273
console.log(`Types file paranext-extension-template.d.ts not found, skipping rename operation`);
271274
}

lib/update-from-templates.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import { ExtensionInfo, getExtensions } from '../webpack/webpack.util';
6262
extensionsBasedOnTemplate.push(ext);
6363
} catch (e) {
6464
if (
65+
e instanceof Error &&
6566
e
6667
.toString()
6768
.toLowerCase()

0 commit comments

Comments
 (0)