Skip to content

Commit 07da41f

Browse files
committed
fixup: remove peer dep check workaround
1 parent 500892a commit 07da41f

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

packages/compass-electron-menu/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"dependencies": {
5656
"bson": "^6.10.4",
5757
"debug": "^4.3.4",
58+
"electron": "^37.6.1",
5859
"react": "^17.0.2"
5960
},
6061
"devDependencies": {
@@ -70,7 +71,6 @@
7071
"@types/react-dom": "^17.0.10",
7172
"@types/sinon-chai": "^3.2.5",
7273
"chai": "^4.3.6",
73-
"electron": "^37.6.1",
7474
"depcheck": "^1.4.1",
7575
"gen-esm-wrapper": "^1.1.0",
7676
"mocha": "^10.2.0",

packages/compass-electron-menu/src/types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// Type-only import in a separate entry point, so this is fine
2-
// compass-peer-deps-ignore
3-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
1+
// NB: We add `electron` as a production dependency because
2+
// of this type import. That's fine because we expect this
3+
// package to only be used in Compass, where we know elecron
4+
// is a dependency anyway.
45
import type { MenuItemConstructorOptions } from 'electron';
56

67
export type { MenuItemConstructorOptions };

scripts/check-peer-deps.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,19 @@ async function collectAllAbsoluteImports(entryPoints = []) {
7777
],
7878
],
7979
});
80-
const shouldSkip = (path) =>
81-
path.node.leadingComments?.some((comment) =>
82-
comment.value?.includes('compass-peer-deps-ignore')
83-
);
8480
traverse(program, {
8581
ImportDeclaration(path) {
86-
if (shouldSkip(path)) return;
8782
queueImport(path.node.source.value);
8883
},
8984
ExportNamedDeclaration(path) {
90-
if (shouldSkip(path)) return;
9185
if (path.node.source) {
9286
queueImport(path.node.source.value);
9387
}
9488
},
9589
ExportAllDeclaration(path) {
96-
if (shouldSkip(path)) return;
9790
queueImport(path.node.source.value);
9891
},
9992
CallExpression(path) {
100-
if (shouldSkip(path)) return;
10193
if (
10294
path.node.callee.type === 'Identifier' &&
10395
(path.node.callee.name === 'require' ||

0 commit comments

Comments
 (0)