Skip to content

Commit 004cfd4

Browse files
authored
chore: run reformat to fix prettier issues (#1036)
1 parent 943c39b commit 004cfd4

File tree

143 files changed

+1980
-1964
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+1980
-1964
lines changed

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ const typescriptEslintEslintPlugin = require('@typescript-eslint/eslint-plugin')
22

33
// Overrides do not work with extends.
44
const ruleOverridesForJs = Object.keys(
5-
typescriptEslintEslintPlugin.rules
5+
typescriptEslintEslintPlugin.rules,
66
).reduce(
77
(overrides, rule) => ({ ...overrides, [`@typescript-eslint/${rule}`]: 0 }),
8-
{}
8+
{},
99
);
1010

1111
const sharedRules = {

scripts/check-vsix-size.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ import fs from 'fs';
22
import path from 'path';
33

44
const version = JSON.parse(
5-
fs.readFileSync(path.resolve(__dirname, '..', 'package.json')).toString()
5+
fs.readFileSync(path.resolve(__dirname, '..', 'package.json')).toString(),
66
).version;
77

88
const vsixFileName = path.resolve(
99
__dirname,
1010
'..',
11-
`./mongodb-vscode-${version}.vsix`
11+
`./mongodb-vscode-${version}.vsix`,
1212
);
1313
const size = fs.statSync(vsixFileName).size;
1414

1515
const maxSize = 8_000_000;
1616

1717
if (size >= maxSize) {
1818
throw new Error(
19-
`vsix bundle too big expected max ${maxSize} bytes, got ${size}.`
19+
`vsix bundle too big expected max ${maxSize} bytes, got ${size}.`,
2020
);
2121
}
2222

scripts/generate-constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ config({ path: resolve(__dirname, '../.env') });
1616
(async () => {
1717
await writeFile(
1818
`${ROOT_DIR}/constants.json`,
19-
JSON.stringify({ segmentKey: process.env.SEGMENT_KEY }, null, 2)
19+
JSON.stringify({ segmentKey: process.env.SEGMENT_KEY }, null, 2),
2020
);
2121
ui.succeed('The constants file has been generated');
2222
})().catch((error) => {

scripts/generate-icon-font.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async function main(): Promise<void> {
5353

5454
// Prints out the VSCode configuration package.json
5555
const currentConfiguration = JSON.parse(
56-
await fs.readFile('./package.json', 'utf8')
56+
await fs.readFile('./package.json', 'utf8'),
5757
);
5858

5959
currentConfiguration.contributes.icons = iconsConfig;
@@ -64,7 +64,7 @@ async function main(): Promise<void> {
6464
prettier.format(JSON.stringify(currentConfiguration), {
6565
...prettierConfig,
6666
parser: 'json-stringify',
67-
})
67+
}),
6868
);
6969
}
7070

scripts/precommit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async function main(fileList: string[]) {
3333

3434
const fileList = process.argv
3535
.slice(
36-
process.argv.findIndex((filename) => filename.includes('precommit')) + 1
36+
process.argv.findIndex((filename) => filename.includes('precommit')) + 1,
3737
)
3838
.filter((arg) => !arg.startsWith('-'))
3939
.map((filePath) => {
@@ -43,5 +43,5 @@ const fileList = process.argv
4343
main(fileList).catch((err) =>
4444
process.nextTick(() => {
4545
throw err;
46-
})
46+
}),
4747
);

scripts/snyk-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function snykTest(cwd) {
2424
'--dev',
2525
`--json-file-output=${tmpPath}`,
2626
],
27-
{ cwd, stdio: 'inherit' }
27+
{ cwd, stdio: 'inherit' },
2828
);
2929
} catch (err) {
3030
console.warn(err);
@@ -51,7 +51,7 @@ async function main() {
5151

5252
await fs.writeFile(
5353
path.join(rootPath, `.sbom/snyk-test-result.json`),
54-
JSON.stringify(results, null, 2)
54+
JSON.stringify(results, null, 2),
5555
);
5656

5757
await execFile(
@@ -63,7 +63,7 @@ async function main() {
6363
'-o',
6464
path.join(rootPath, `.sbom/snyk-test-result.html`),
6565
],
66-
{ cwd: rootPath }
66+
{ cwd: rootPath },
6767
);
6868
}
6969

scripts/update-grammar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const injectionGrammar = {
4949
ui.succeed(`The '${SYNTAXES_DIR}' folder has been created`);
5050
await writeFile(
5151
`${SYNTAXES_DIR}/mongodbInjection.tmLanguage.json`,
52-
JSON.stringify(injectionGrammar, null, 2)
52+
JSON.stringify(injectionGrammar, null, 2),
5353
);
5454
ui.succeed('MongoDB injection grammar has been saved');
5555
})();

src/commands/launchMongoShell.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ const getBashEnvString = (): string => {
4646
};
4747

4848
const openMongoDBShell = (
49-
connectionController: ConnectionController
49+
connectionController: ConnectionController,
5050
): Promise<boolean> => {
5151
if (!connectionController.isCurrentlyConnected()) {
5252
void vscode.window.showErrorMessage(
53-
'You need to be connected before launching the MongoDB Shell.'
53+
'You need to be connected before launching the MongoDB Shell.',
5454
);
5555
return Promise.resolve(false);
5656
}
@@ -62,14 +62,14 @@ const openMongoDBShell = (
6262

6363
if (!userShell) {
6464
void vscode.window.showErrorMessage(
65-
'No shell found, please set your default shell environment in vscode.'
65+
'No shell found, please set your default shell environment in vscode.',
6666
);
6767
return Promise.resolve(false);
6868
}
6969

7070
if (!shellCommand) {
7171
void vscode.window.showErrorMessage(
72-
'No MongoDB shell command found. Please set the shell command in the MongoDB extension settings.'
72+
'No MongoDB shell command found. Please set the shell command in the MongoDB extension settings.',
7373
);
7474
return Promise.resolve(false);
7575
}

src/editors/activeConnectionCodeLensProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class ActiveConnectionCodeLensProvider
2929
};
3030
this._connectionController.addEventListener(
3131
DataServiceEventTypes.ACTIVE_CONNECTION_CHANGED,
32-
this._activeConnectionChangedHandler
32+
this._activeConnectionChangedHandler,
3333
);
3434
}
3535

@@ -68,7 +68,7 @@ export default class ActiveConnectionCodeLensProvider
6868
deactivate(): void {
6969
this._connectionController.removeEventListener(
7070
DataServiceEventTypes.ACTIVE_CONNECTION_CHANGED,
71-
this._activeConnectionChangedHandler
71+
this._activeConnectionChangedHandler,
7272
);
7373
}
7474
}

src/editors/collectionDocumentsCodeLensProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export default class CollectionDocumentsCodeLensProvider
4949
new vscode.CodeLens(
5050
new vscode.Range(
5151
new vscode.Position(document.lineCount - 1, 0),
52-
new vscode.Position(document.lineCount, 0)
53-
)
52+
new vscode.Position(document.lineCount, 0),
53+
),
5454
),
5555
];
5656

src/editors/collectionDocumentsOperationsStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default class CollectionDocumentsOperationsStore {
2626
.getConfiguration('mdb')
2727
.get(DEFAULT_LIMIT_CONFIG_NAME);
2828
this.operations[operationId] = new CollectionDocumentsOperation(
29-
Number(initialDocumentsLimit)
29+
Number(initialDocumentsLimit),
3030
);
3131

3232
return operationId;
@@ -39,7 +39,7 @@ export default class CollectionDocumentsOperationsStore {
3939
.getConfiguration('mdb')
4040
.get(DEFAULT_LIMIT_CONFIG_NAME);
4141
this.operations[operationId].currentLimit += Number(
42-
additionalDocumentsToFetch
42+
additionalDocumentsToFetch,
4343
);
4444
}
4545
}

src/editors/collectionDocumentsProvider.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default class CollectionViewProvider
5353

5454
if (!operationId) {
5555
void vscode.window.showErrorMessage(
56-
'Unable to list documents: invalid operation'
56+
'Unable to list documents: invalid operation',
5757
);
5858

5959
throw new Error('Unable to list documents: invalid operation');
@@ -69,11 +69,11 @@ export default class CollectionViewProvider
6969
this._connectionController.getSavedConnectionName(connectionId || '') ||
7070
'the database';
7171
void vscode.window.showErrorMessage(
72-
`Unable to list documents: no longer connected to ${oldConnectionName}`
72+
`Unable to list documents: no longer connected to ${oldConnectionName}`,
7373
);
7474

7575
throw new Error(
76-
`Unable to list documents: no longer connected to ${oldConnectionName}`
76+
`Unable to list documents: no longer connected to ${oldConnectionName}`,
7777
);
7878
}
7979

@@ -93,7 +93,7 @@ export default class CollectionViewProvider
9393
const documents = await dataservice.find(
9494
namespace,
9595
{}, // No filter.
96-
{ limit: documentLimit }
96+
{ limit: documentLimit },
9797
);
9898

9999
operation.isCurrentlyFetchingMoreDocuments = false;

src/editors/documentIdStore.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default class DocumentIdStore {
1212

1313
add(documentId: any): string {
1414
const existingDocument = this._documents.find(
15-
(item) => item.documentId === documentId
15+
(item) => item.documentId === documentId,
1616
);
1717

1818
if (existingDocument) {
@@ -34,15 +34,15 @@ export default class DocumentIdStore {
3434

3535
get(documentIdReference: string): any {
3636
const existingDocument = this._documents.find(
37-
(item) => item.documentIdReference === documentIdReference
37+
(item) => item.documentIdReference === documentIdReference,
3838
);
3939

4040
return existingDocument?.documentId;
4141
}
4242

4343
removeByDocumentIdReference(documentIdReference: string): void {
4444
this._documents = this._documents.filter(
45-
(item) => item.documentIdReference !== documentIdReference
45+
(item) => item.documentIdReference !== documentIdReference,
4646
);
4747
}
4848
}

0 commit comments

Comments
 (0)