Skip to content

Commit 6bc370b

Browse files
committed
merge
2 parents 009cf07 + 52126b6 commit 6bc370b

File tree

315 files changed

+6429
-4074
lines changed

Some content is hidden

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

315 files changed

+6429
-4074
lines changed

.esbuild.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { copyFile, mkdir } from 'fs/promises';
1010
import { glob } from 'glob';
1111
import * as path from 'path';
1212

13-
const REPO_ROOT = path.join(__dirname);
13+
const REPO_ROOT = import.meta.dirname;
1414
const isWatch = process.argv.includes('--watch');
1515
const isDev = process.argv.includes('--dev');
1616
const isPreRelease = process.argv.includes('--prerelease');
@@ -122,10 +122,10 @@ const sanityTestBundlePlugin: esbuild.Plugin = {
122122
};
123123

124124
const importMetaPlugin: esbuild.Plugin = {
125-
name: 'claudeCodeImportMetaPlugin',
125+
name: 'claudeAgentSdkImportMetaPlugin',
126126
setup(build) {
127-
// Handle import.meta.url in @anthropic-ai/claude-code package
128-
build.onLoad({ filter: /node_modules[\/\\]@anthropic-ai[\/\\]claude-code[\/\\].*\.mjs$/ }, async (args) => {
127+
// Handle import.meta.url in @anthropic-ai/claude-agent-sdk package
128+
build.onLoad({ filter: /node_modules[\/\\]@anthropic-ai[\/\\]claude-agent-sdk[\/\\].*\.mjs$/ }, async (args) => {
129129
const contents = await fs.promises.readFile(args.path, 'utf8');
130130
return {
131131
contents: contents.replace(
@@ -251,8 +251,8 @@ const nodeSimulationWorkbenchUIBuildOptions = {
251251

252252
async function typeScriptServerPluginPackageJsonInstall(): Promise<void> {
253253
await mkdir('./node_modules/@vscode/copilot-typescript-server-plugin', { recursive: true });
254-
const source = path.join(__dirname, './src/extension/typescriptContext/serverPlugin/package.json');
255-
const destination = path.join(__dirname, './node_modules/@vscode/copilot-typescript-server-plugin/package.json');
254+
const source = path.join(import.meta.dirname, './src/extension/typescriptContext/serverPlugin/package.json');
255+
const destination = path.join(import.meta.dirname, './node_modules/@vscode/copilot-typescript-server-plugin/package.json');
256256
try {
257257
await copyFile(source, destination);
258258
} catch (error) {
@@ -369,7 +369,7 @@ async function main() {
369369
}
370370

371371
function applyPackageJsonPatch(isPreRelease: boolean) {
372-
const packagejsonPath = path.join(__dirname, './package.json');
372+
const packagejsonPath = path.join(import.meta.dirname, './package.json');
373373
const json = JSON.parse(fs.readFileSync(packagejsonPath).toString());
374374

375375
const newProps: any = {

.eslintplugin/index.js

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

.eslintplugin/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
import type { LooseRuleDefinition } from '@typescript-eslint/utils/ts-eslint';
6+
import * as glob from 'glob';
7+
import path from 'path';
8+
9+
// Re-export all .ts files as rules
10+
const rules: Record<string, LooseRuleDefinition> = {};
11+
await Promise.all(
12+
glob.sync('*.ts', { cwd: import.meta.dirname })
13+
.filter(file => !file.endsWith('index.ts') && !file.endsWith('utils.ts'))
14+
.map(async file => {
15+
rules[path.basename(file, '.ts')] = (await import('./' + file)).default;
16+
})
17+
);
18+
19+
export { rules };

.eslintplugin/no-bad-gdpr-comment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
import * as eslint from 'eslint';
77

8-
export = new class NoBadGDPRComment implements eslint.Rule.RuleModule {
8+
export default new class NoBadGDPRComment implements eslint.Rule.RuleModule {
99

1010
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
1111

1212
return {
1313
['Program'](node) {
14-
for (const comment of (<eslint.AST.Program>node).comments) {
14+
for (const comment of (node as eslint.AST.Program).comments) {
1515
if (comment.type !== 'Block' || !comment.loc) {
1616
continue;
1717
}

.eslintplugin/no-funny-filename.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as eslint from 'eslint';
77
import { readdirSync } from 'fs';
88
import path from 'path';
99

10-
export = new class NoTestOnly implements eslint.Rule.RuleModule {
10+
export default new class NoTestOnly implements eslint.Rule.RuleModule {
1111

1212
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
1313

.eslintplugin/no-gdpr-event-name-mismatch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { TSESTree } from '@typescript-eslint/typescript-estree';
77
import * as eslint from 'eslint';
88

9-
export = new class NoGDPREventNameMismatch implements eslint.Rule.RuleModule {
9+
export default new class NoGDPREventNameMismatch implements eslint.Rule.RuleModule {
1010

1111
readonly meta: eslint.Rule.RuleMetaData = {
1212
type: "problem",
@@ -56,7 +56,7 @@ export = new class NoGDPREventNameMismatch implements eslint.Rule.RuleModule {
5656

5757
return {
5858
['ExpressionStatement MemberExpression Identifier[name=/^send.*TelemetryEvent$/]'](node: any) {
59-
const esNode = <TSESTree.Identifier>node;
59+
const esNode = node as TSESTree.Identifier;
6060
const gdprCommentEventName = getEventNameFromLeadingGdprComment(esNode);
6161
if (!gdprCommentEventName) {
6262
return;

.eslintplugin/no-instanceof-uri.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as eslint from 'eslint';
77

8-
export = new class NoInstanceofUri implements eslint.Rule.RuleModule {
8+
export default new class NoInstanceofUri implements eslint.Rule.RuleModule {
99
readonly meta: eslint.Rule.RuleMetaData = {
1010
type: "problem",
1111
fixable: "code",

.eslintplugin/no-missing-linebreak.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as eslint from 'eslint';
77

8-
export = new class MissingTSXLinebreak implements eslint.Rule.RuleModule {
8+
export default new class MissingTSXLinebreak implements eslint.Rule.RuleModule {
99

1010
readonly meta: eslint.Rule.RuleMetaData = {
1111
type: "problem",

.eslintplugin/no-nls-localize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as eslint from 'eslint';
7-
import { createImportRuleListener } from './utils';
7+
import { createImportRuleListener } from './utils.ts';
88

9-
export = new class implements eslint.Rule.RuleModule {
9+
export default new class implements eslint.Rule.RuleModule {
1010

1111
readonly meta: eslint.Rule.RuleMetaData = {
1212
messages: {

.eslintplugin/no-restricted-copilot-pr-string.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as eslint from 'eslint';
77

8-
export = new class NoBadGDPRComment implements eslint.Rule.RuleModule {
8+
export default new class NoBadGDPRComment implements eslint.Rule.RuleModule {
99
readonly meta: eslint.Rule.RuleMetaData = {
1010
type: 'problem',
1111
docs: {

0 commit comments

Comments
 (0)