Skip to content

Commit 32c890b

Browse files
committed
chore: add depcheck to 6 packages
1 parent 5842961 commit 32c890b

File tree

11 files changed

+92
-56
lines changed

11 files changed

+92
-56
lines changed

configs/webpack-config-compass/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@
3636
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
3737
"compile": "tsc -p tsconfig.json",
3838
"postcompile": "gen-esm-wrapper . ./dist/.esm-wrapper.mjs",
39+
"typecheck": "tsc -p tsconfig-lint.json --noEmit",
3940
"eslint": "eslint-compass",
4041
"prettier": "prettier-compass",
4142
"lint": "npm run eslint . && npm run prettier -- --check .",
4243
"depcheck": "depcheck",
43-
"check": "npm run lint && npm run depcheck",
44+
"check": "npm run typecheck && npm run lint && npm run depcheck",
4445
"check-ci": "npm run check",
4546
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write ."
4647
},

packages/compass-app-registry/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@
3636
"bootstrap": "npm run compile",
3737
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
3838
"compile": "tsc -p tsconfig.json && gen-esm-wrapper . ./dist/.esm-wrapper.mjs",
39+
"typecheck": "tsc -p tsconfig-lint.json --noEmit",
3940
"eslint": "eslint-compass",
4041
"prettier": "prettier-compass",
4142
"lint": "npm run eslint . && npm run prettier -- --check .",
4243
"depcheck": "compass-scripts check-peer-deps && depcheck",
43-
"check": "npm run lint && npm run depcheck",
44+
"check": "npm run typecheck && npm run lint && npm run depcheck",
4445
"check-ci": "npm run check",
4546
"test": "mocha",
4647
"test-cov": "nyc --compact=false --produce-source-map=false -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test",

packages/compass-connections-navigation/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@
3636
"bootstrap": "npm run compile",
3737
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
3838
"compile": "tsc -p tsconfig.json",
39+
"typecheck": "tsc -p tsconfig-lint.json --noEmit",
3940
"eslint": "eslint-compass",
4041
"prettier": "prettier-compass",
4142
"lint": "npm run eslint . && npm run prettier -- --check .",
4243
"depcheck": "compass-scripts check-peer-deps && depcheck",
43-
"check": "npm run lint && npm run depcheck",
44+
"check": "npm run typecheck && npm run lint && npm run depcheck",
4445
"check-ci": "npm run check",
4546
"test": "mocha",
4647
"test-cov": "nyc --compact=false --produce-source-map=false -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test",

packages/compass-connections-navigation/src/connections-navigation-tree.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ describe('ConnectionsNavigationTree', function () {
286286
{
287287
...connections[0],
288288
csfleMode: 'enabled',
289-
},
289+
} as Connection,
290290
connections[1],
291291
connections[2],
292292
];
@@ -312,7 +312,7 @@ describe('ConnectionsNavigationTree', function () {
312312
{
313313
...connections[0],
314314
csfleMode: 'disabled',
315-
},
315+
} as Connection,
316316
connections[1],
317317
connections[2],
318318
];
@@ -326,7 +326,7 @@ describe('ConnectionsNavigationTree', function () {
326326
{
327327
...connections[0],
328328
csfleMode: 'unavailable',
329-
},
329+
} as Connection,
330330
connections[1],
331331
connections[2],
332332
];

packages/compass-connections-navigation/src/virtual-list/virtual-list.spec.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ function NavigationTree({
9898
onDefaultAction={() => {}}
9999
onItemExpand={onExpandedChange}
100100
onItemAction={() => {}}
101-
getItemActions={() => []}
101+
getItemActions={() => ({ actions: [] })}
102+
getContextMenuGroups={() => []}
102103
width={100}
103104
renderItem={({ item }) => item.name}
104105
__TEST_OVER_SCAN_COUNT={Infinity}

packages/compass-data-modeling/src/components/drawer/relationships-section.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import { getDefaultRelationshipName } from '../../utils';
1515
const titleBtnStyles = css({
1616
marginLeft: 'auto',
1717
maxHeight: 20, // To match accordion line height
18+
overflow: 'hidden',
19+
textOverflow: 'ellipsis',
20+
whiteSpace: 'nowrap',
1821
});
1922

2023
const emptyRelationshipMessageStyles = css({

packages/compass-logging/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@
3838
"bootstrap": "npm run compile",
3939
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
4040
"compile": "tsc -p tsconfig.json",
41+
"typecheck": "tsc -p tsconfig-lint.json --noEmit",
4142
"eslint": "eslint-compass",
4243
"prettier": "prettier-compass",
4344
"lint": "npm run eslint . && npm run prettier -- --check .",
4445
"depcheck": "compass-scripts check-peer-deps && depcheck",
45-
"check": "npm run lint && npm run depcheck",
46+
"check": "npm run typecheck && npm run lint && npm run depcheck",
4647
"check-ci": "npm run check",
4748
"test": "mocha",
4849
"test-cov": "nyc --compact=false --produce-source-map=false -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test",

packages/databases-collections-list/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@
3535
"bootstrap": "npm run compile",
3636
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
3737
"compile": "tsc -p tsconfig.json",
38+
"typecheck": "tsc -p tsconfig-lint.json --noEmit",
3839
"eslint": "eslint-compass",
3940
"prettier": "prettier-compass",
4041
"lint": "npm run eslint . && npm run prettier -- --check .",
4142
"depcheck": "compass-scripts check-peer-deps && depcheck",
42-
"check": "npm run lint && npm run depcheck",
43+
"check": "npm run typecheck && npm run lint && npm run depcheck",
4344
"check-ci": "npm run check",
4445
"test": "mocha",
4546
"test-cov": "nyc --compact=false --produce-source-map=false -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test",

packages/databases-collections-list/src/index.spec.tsx

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import {
1313
PreferencesProvider,
1414
} from 'compass-preferences-model/provider';
1515
import { createSandboxFromDefaultPreferences } from 'compass-preferences-model';
16+
import type { CollectionProps } from 'mongodb-collection-model';
17+
import type { DatabaseProps } from 'mongodb-database-model';
1618

17-
function createDatabase(name) {
19+
function createDatabase(name: string): DatabaseProps {
1820
return {
1921
_id: name,
2022
name: name,
@@ -35,7 +37,10 @@ function createDatabase(name) {
3537
};
3638
}
3739

38-
function createCollection(name, props: any = {}) {
40+
function createCollection(
41+
name: string,
42+
props: Partial<CollectionProps> = {}
43+
): CollectionProps {
3944
const col = {
4045
_id: name,
4146
name: name,
@@ -71,6 +76,7 @@ function createCollection(name, props: any = {}) {
7176
free_storage_size: 1000,
7277
index_count: 15,
7378
index_size: 16,
79+
calculated_storage_size: undefined,
7480
...props,
7581
};
7682

@@ -81,21 +87,24 @@ function createCollection(name, props: any = {}) {
8187
return col;
8288
}
8389

84-
function createTimeSeries(name, props: any = {}) {
90+
function createTimeSeries(
91+
name: string,
92+
props: Partial<CollectionProps> = {}
93+
): CollectionProps {
8594
return {
8695
...createCollection(name, props),
8796
type: 'timeseries' as const,
8897
};
8998
}
9099

91-
const dbs = [
100+
const dbs: DatabaseProps[] = [
92101
createDatabase('foo'),
93102
createDatabase('bar'),
94103
createDatabase('buz'),
95104
createDatabase('bat'),
96105
];
97106

98-
const colls = [
107+
const colls: CollectionProps[] = [
99108
createCollection('foo.foo', { storage_size: 1000, free_storage_size: 1000 }), // 1000
100109
createCollection('bar.bar', { storage_size: 2000, free_storage_size: 500 }), // 1500
101110
createCollection('buz.buz', { storage_size: 3000, free_storage_size: 2000 }), // 1000
@@ -112,10 +121,16 @@ describe('databases and collections list', function () {
112121

113122
afterEach(cleanup);
114123

115-
const renderDatabasesList = (props) => {
124+
const renderDatabasesList = (
125+
props: Partial<React.ComponentProps<typeof DatabasesList>>
126+
) => {
116127
render(
117128
<PreferencesProvider value={preferences}>
118-
<DatabasesList {...props}></DatabasesList>
129+
<DatabasesList
130+
databases={[]}
131+
onDatabaseClick={() => {}}
132+
{...props}
133+
></DatabasesList>
119134
</PreferencesProvider>
120135
);
121136
};
@@ -190,10 +205,17 @@ describe('databases and collections list', function () {
190205

191206
afterEach(cleanup);
192207

193-
const renderCollectionsList = (props) => {
208+
const renderCollectionsList = (
209+
props: Partial<React.ComponentProps<typeof CollectionsList>>
210+
) => {
194211
render(
195212
<PreferencesProvider value={preferences}>
196-
<CollectionsList {...props}></CollectionsList>
213+
<CollectionsList
214+
onCollectionClick={() => {}}
215+
namespace="db"
216+
collections={[]}
217+
{...props}
218+
></CollectionsList>
197219
</PreferencesProvider>
198220
);
199221
};

packages/explain-plan-helper/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@
3636
"bootstrap": "npm run compile",
3737
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
3838
"compile": "tsc -p tsconfig.json && gen-esm-wrapper . ./dist/.esm-wrapper.mjs",
39+
"typecheck": "tsc -p tsconfig-lint.json --noEmit",
3940
"eslint": "eslint-compass",
4041
"prettier": "prettier-compass",
4142
"lint": "npm run eslint . && npm run prettier -- --check .",
4243
"depcheck": "compass-scripts check-peer-deps && depcheck",
43-
"check": "npm run lint && npm run depcheck",
44+
"check": "npm run typecheck && npm run lint && npm run depcheck",
4445
"check-ci": "npm run check",
4546
"test": "mocha",
4647
"test-cov": "nyc --compact=false --produce-source-map=false -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test",

0 commit comments

Comments
 (0)