Skip to content

Commit 5f5c79f

Browse files
committed
fix(ci): restore lint and completion test stability
1 parent 0844e67 commit 5f5c79f

4 files changed

Lines changed: 50 additions & 12 deletions

File tree

eslint.config.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,29 @@ export default tseslint.config(
231231

232232
// VS Code IDE companion - out of scope for no-console rule
233233
{
234-
files: ['packages/vscode-ide-companion/**/*.ts', 'packages/vscode-ide-companion/**/*.tsx', 'packages/vscode-ide-companion/**/*.js'],
235-
rules: { 'no-console': 'off' },
234+
files: [
235+
'packages/vscode-ide-companion/**/*.ts',
236+
'packages/vscode-ide-companion/**/*.tsx',
237+
'packages/vscode-ide-companion/**/*.js',
238+
],
239+
plugins: {
240+
import: importPlugin,
241+
},
242+
rules: {
243+
'no-console': 'off',
244+
'import/no-internal-modules': [
245+
'error',
246+
{
247+
allow: [
248+
'react-dom/client',
249+
'./styles/**',
250+
'./styles/tailwind.css',
251+
'./styles/App.css',
252+
'@qwen-code/qwen-code-core/src/**',
253+
],
254+
},
255+
],
256+
},
236257
},
237258
// WebUI package - UI component library with Storybook
238259
{

packages/cli/src/ui/hooks/useAtCompletion.test.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,24 @@ describe('useAtCompletion', () => {
116116
expect(result.current.suggestions.length).toBeGreaterThan(0);
117117
});
118118

119-
expect(result.current.suggestions.map((s) => s.value)).toEqual([
120-
'src/',
121-
'src/components/',
122-
'src/index.js',
123-
'src/components/Button.tsx',
124-
]);
119+
const values = result.current.suggestions.map((s) => s.value);
120+
expect(values).toHaveLength(4);
121+
expect(values).toEqual(
122+
expect.arrayContaining([
123+
'src/',
124+
'src/components/',
125+
'src/components/Button.tsx',
126+
'src/index.js',
127+
]),
128+
);
125129
});
126130

127131
it('should append a trailing slash to directory paths in suggestions', async () => {
128132
const structure: FileSystemStructure = {
129133
'file.txt': '',
130-
dir: {},
134+
dir: {
135+
'nested.txt': '',
136+
},
131137
};
132138
testRootDir = await createTmpDir(structure);
133139

@@ -141,6 +147,7 @@ describe('useAtCompletion', () => {
141147

142148
expect(result.current.suggestions.map((s) => s.value)).toEqual([
143149
'dir/',
150+
'dir/nested.txt',
144151
'file.txt',
145152
]);
146153
});
@@ -384,7 +391,9 @@ describe('useAtCompletion', () => {
384391
'.gitignore': gitignoreContent,
385392
dist: {},
386393
'test.log': '',
387-
src: {},
394+
src: {
395+
'index.ts': '',
396+
},
388397
};
389398
testRootDir = await createTmpDir(structure);
390399

@@ -399,6 +408,7 @@ describe('useAtCompletion', () => {
399408
expect(result.current.suggestions.map((s) => s.value)).toEqual([
400409
'src/',
401410
'.gitignore',
411+
'src/index.ts',
402412
]);
403413
});
404414

packages/vscode-ide-companion/eslint.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,15 @@ export default [
5959
// Restrict deep imports but allow known-safe exceptions used by the webview
6060
// - react-dom/client: required for React 18's createRoot API
6161
// - ./styles/**: local CSS modules loaded by the webview
62+
// - @qwen-code/qwen-code-core/src/**: extension bridges to core internals
6263
'import/no-internal-modules': [
6364
'error',
6465
{
65-
allow: ['react-dom/client', './styles/**'],
66+
allow: [
67+
'react-dom/client',
68+
'./styles/**',
69+
'@qwen-code/qwen-code-core/src/**',
70+
],
6671
},
6772
],
6873

packages/vscode-ide-companion/src/utils/editorGroupUtils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ function findNeighborGroup(
2929
): vscode.ViewColumn | undefined {
3030
let candidate: vscode.ViewColumn | undefined;
3131
for (const g of vscode.window.tabGroups.all) {
32-
if (!isOnSide(g.viewColumn)) continue;
32+
if (!isOnSide(g.viewColumn)) {
33+
continue;
34+
}
3335
if (candidate === undefined || isCloser(candidate, g.viewColumn)) {
3436
candidate = g.viewColumn;
3537
}

0 commit comments

Comments
 (0)