Skip to content

Commit a3c4f0b

Browse files
committed
Merge branch 'main' into copilot/fix-7280
2 parents c4a22ad + f746fcf commit a3c4f0b

File tree

186 files changed

+16751
-8855
lines changed

Some content is hidden

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

186 files changed

+16751
-8855
lines changed

.eslintrc.base.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@
6666
"no-useless-return": "off",
6767
"no-var": "error",
6868
"no-with": "error",
69+
"no-restricted-syntax": [
70+
"error",
71+
{
72+
"selector": "BinaryExpression[operator='in']",
73+
"message": "Avoid using the 'in' operator for type checks."
74+
}
75+
],
6976
"object-shorthand": "off",
7077
"one-var": "off", // TODO@eamodio revisit
7178
// "one-var": ["error", "never"],
@@ -230,7 +237,7 @@
230237
"@typescript-eslint/no-unsafe-member-access": "off", // TODO@eamodio revisit
231238
"@typescript-eslint/no-unsafe-return": "off", // TODO@eamodio revisit
232239
"@typescript-eslint/no-unused-expressions": ["warn", { "allowShortCircuit": true }],
233-
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
240+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
234241
// "@typescript-eslint/no-unused-vars": [
235242
// "warn",
236243
// {

.eslintrc.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
'use strict';
7+
8+
const RULES_DIR = require('eslint-plugin-rulesdir');
9+
RULES_DIR.RULES_DIR = './build/eslint-rules';
10+
11+
module.exports = {
12+
extends: ['.eslintrc.base.json'],
13+
env: {
14+
browser: true,
15+
node: true
16+
},
17+
parserOptions: {
18+
project: 'tsconfig.eslint.json'
19+
},
20+
plugins: ['rulesdir'],
21+
overrides: [
22+
{
23+
files: ['webviews/**/*.ts', 'webviews/**/*.tsx'],
24+
rules: {
25+
'rulesdir/public-methods-well-defined-types': 'error'
26+
}
27+
},
28+
{
29+
files: ['**/*.ts', '**/*.tsx'],
30+
rules: {
31+
'rulesdir/no-any-except-union-method-signature': 'error',
32+
'rulesdir/no-pr-in-user-strings': 'error'
33+
}
34+
}
35+
]
36+
};

.eslintrc.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/copilot-instructions.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,19 @@
1313
- **Webviews**: Place webview code in the `webviews/` directory. Use the shared `common/` code where possible.
1414
- **Commands**: Register new commands in `package.json` and implement them in `src/commands.ts` or a relevant module.
1515
- **Logging**: Use the `Logger` utility for all logging purposes. Don't use console.log or similar methods directly.
16+
- **Test Running**: Use tools over tasks over scripts to run tests.
17+
18+
## Specific Feature Practices
19+
- **Commands**: When adding a new command, consider whether it should be available in the command palette, context menus, or both. Add the appropriate menu entries in `package.json` to ensure the command is properly included, or excluded (command palette), from menus.
1620

1721
## Pull Request Guidelines
1822
- Never touch the yarn.lock file.
23+
- Run `yarn run lint` and also `npm run hygiene` and fix any errors or warnings before committing.
24+
25+
## Testing
26+
- Use `describe` and `it` blocks from Mocha for structuring tests.
27+
- Tests MUST run product code.
28+
- Tests should be placed near the code they are testing, in a `test` folder. Name test fies with a `.test.ts` suffix.
1929

2030
---
2131
_Last updated: 2025-06-20_

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
. "$(dirname -- "$0")/_/husky.sh"
33

44
npm run hygiene
5+
npm run lint

.vscode-test.mjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
import { defineConfig } from "@vscode/test-cli";
3+
4+
/**
5+
* @param {string} label
6+
*/
7+
function generateConfig(label) {
8+
/** @type {import('@vscode/test-cli').TestConfiguration} */
9+
let config = {
10+
label,
11+
files: ["dist/**/*.test.js"],
12+
version: "insiders",
13+
srcDir: "src",
14+
launchArgs: [
15+
"--enable-proposed-api",
16+
"--disable-extension=GitHub.vscode-pull-request-github-insiders",
17+
],
18+
// env,
19+
mocha: {
20+
ui: "bdd",
21+
color: true,
22+
timeout: 25000
23+
},
24+
};
25+
26+
return config;
27+
}
28+
29+
export default defineConfig(generateConfig("Local Tests"));

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"recommendations": [
33
"dbaeumer.vscode-eslint",
4-
"amodio.tsl-problem-matcher"
4+
"amodio.tsl-problem-matcher",
5+
"ms-vscode.extension-test-runner"
56
]
67
}

.vscode/launch.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,11 @@
102102
"type": "node",
103103
"request": "launch",
104104
"name": "Attach Web Test",
105-
"program": "${workspaceFolder}/node_modules/vscode-test-web/out/index.js",
105+
"program": "${workspaceFolder}/node_modules/@vscode/test-web/out/server/index.js",
106106
"args": [
107107
"--extensionTestsPath=dist/browser/test/index.js",
108108
"--extensionDevelopmentPath=.",
109109
"--browserType=chromium",
110-
"--attach=9229"
111110
],
112111
"cascadeTerminateToConfigurations": [
113112
"Launch Web Test"

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
".eslintrc.json": "jsonc",
55
".eslintrc.*.json": "jsonc"
66
},
7+
"json.schemas": [
8+
{
9+
"fileMatch": [
10+
"**/.eslintrc.*.json"
11+
],
12+
"url": "https://json.schemastore.org/eslintrc"
13+
}
14+
],
715
"files.trimTrailingWhitespace": true,
816
"gitlens.advanced.blame.customArguments": ["--ignore-revs-file", ".gitignore-revs"]
917
}

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ node_modules/**
1212
scripts/**
1313
src/**
1414
webviews/**
15+
**/test/**
1516
.eslintcache*
1617
.eslintignore
1718
.eslintrc*

0 commit comments

Comments
 (0)