Skip to content

Commit 2778364

Browse files
committed
fix lint
1 parent e8022f1 commit 2778364

File tree

3 files changed

+325
-2
lines changed

3 files changed

+325
-2
lines changed

.oxlintrc.json

Lines changed: 324 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,324 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": [],
4+
"categories": {
5+
"correctness": "off"
6+
},
7+
"env": {
8+
"builtin": true
9+
},
10+
"ignorePatterns": [
11+
"**/*.js",
12+
"out/**",
13+
"dist/**",
14+
"dist-dev/**",
15+
"node_modules/**",
16+
".vscode-test.mjs",
17+
"legacy-backup/**",
18+
"labs/**",
19+
"dev/**",
20+
"src/utils/consts.ts"
21+
],
22+
"rules": {
23+
"constructor-super": "error",
24+
"for-direction": "error",
25+
"no-async-promise-executor": "error",
26+
"no-case-declarations": "error",
27+
"no-class-assign": "error",
28+
"no-compare-neg-zero": "error",
29+
"no-cond-assign": "error",
30+
"no-const-assign": "error",
31+
"no-constant-binary-expression": "error",
32+
"no-constant-condition": "error",
33+
"no-control-regex": "error",
34+
"no-debugger": "error",
35+
"no-delete-var": "error",
36+
"no-dupe-class-members": "error",
37+
"no-dupe-else-if": "error",
38+
"no-dupe-keys": "error",
39+
"no-duplicate-case": "error",
40+
"no-empty": "error",
41+
"no-empty-character-class": "error",
42+
"no-empty-pattern": "error",
43+
"no-empty-static-block": "error",
44+
"no-ex-assign": "error",
45+
"no-extra-boolean-cast": "error",
46+
"no-fallthrough": "error",
47+
"no-func-assign": "error",
48+
"no-global-assign": "error",
49+
"no-import-assign": "error",
50+
"no-invalid-regexp": "error",
51+
"no-irregular-whitespace": "error",
52+
"no-loss-of-precision": "error",
53+
"no-misleading-character-class": "error",
54+
"no-new-native-nonconstructor": "error",
55+
"no-nonoctal-decimal-escape": "error",
56+
"no-obj-calls": "error",
57+
"no-prototype-builtins": "error",
58+
"no-redeclare": "error",
59+
"no-regex-spaces": "error",
60+
"no-self-assign": "error",
61+
"no-setter-return": "error",
62+
"no-shadow-restricted-names": "error",
63+
"no-sparse-arrays": "error",
64+
"no-this-before-super": "error",
65+
"no-unexpected-multiline": "error",
66+
"no-unsafe-finally": "error",
67+
"no-unsafe-negation": "error",
68+
"no-unsafe-optional-chaining": "error",
69+
"no-unused-labels": "error",
70+
"no-unused-private-class-members": "error",
71+
"no-unused-vars": "error",
72+
"no-unreachable": "error",
73+
"no-unused-expressions": "error",
74+
"no-useless-backreference": "error",
75+
"no-useless-catch": "error",
76+
"no-useless-computed-key": "error",
77+
"no-useless-concat": "warn",
78+
"no-useless-constructor": "error",
79+
"no-useless-escape": "error",
80+
"no-useless-rename": "error",
81+
"no-useless-return": "error",
82+
"no-with": "error",
83+
"require-yield": "error",
84+
"use-isnan": "error",
85+
"valid-typeof": "error"
86+
},
87+
"overrides": [
88+
{
89+
"files": [
90+
"**/*.ts",
91+
"**/*.tsx"
92+
],
93+
"rules": {
94+
"no-unused-vars": "off",
95+
"@typescript-eslint/no-unused-vars": "error",
96+
"@typescript-eslint/no-useless-empty-export": "error",
97+
"complexity": [
98+
"warn",
99+
{
100+
"max": 15
101+
}
102+
],
103+
"@typescript-eslint/no-floating-promises": "error",
104+
"@typescript-eslint/no-misused-promises": "error",
105+
"@typescript-eslint/await-thenable": "error",
106+
"import-x/no-duplicates": "error",
107+
"import-x/max-dependencies": [
108+
"warn",
109+
{
110+
"max": 15
111+
}
112+
],
113+
"@typescript-eslint/consistent-type-imports": [
114+
"error",
115+
{
116+
"prefer": "type-imports",
117+
"fixStyle": "separate-type-imports"
118+
}
119+
],
120+
"@typescript-eslint/no-explicit-any": "warn",
121+
"@typescript-eslint/no-unsafe-assignment": "warn",
122+
"@typescript-eslint/no-unsafe-argument": "warn",
123+
"@typescript-eslint/no-unsafe-member-access": "warn",
124+
"@typescript-eslint/no-unsafe-call": "warn",
125+
"@typescript-eslint/no-unsafe-return": "warn",
126+
"@typescript-eslint/no-unsafe-type-assertion": "warn",
127+
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
128+
"@typescript-eslint/no-unnecessary-condition": "warn",
129+
"@typescript-eslint/prefer-nullish-coalescing": "warn",
130+
"@typescript-eslint/strict-boolean-expressions": "warn",
131+
"import-x/no-cycle": [
132+
"error",
133+
{
134+
"maxDepth": 3
135+
}
136+
],
137+
"no-nested-ternary": "error",
138+
"max-params": [
139+
"warn",
140+
{
141+
"max": 10
142+
}
143+
],
144+
"no-console": [
145+
"warn",
146+
{
147+
"allow": [
148+
"warn",
149+
"error"
150+
]
151+
}
152+
],
153+
"promise/no-multiple-resolved": "error",
154+
"promise/no-new-statics": "error",
155+
"promise/valid-params": "error",
156+
"unicorn/no-useless-spread": "error",
157+
"unicorn/no-useless-length-check": "error",
158+
"unicorn/no-unnecessary-await": "error",
159+
"unicorn/no-await-in-promise-methods": "error",
160+
"unicorn/no-single-promise-in-promise-methods": "error",
161+
"unicorn/no-invalid-remove-event-listener": "error",
162+
"oxc/only-used-in-recursion": "error",
163+
"oxc/uninvoked-array-callback": "error",
164+
"oxc/missing-throw": "error"
165+
},
166+
"globals": {
167+
"console": "readonly",
168+
"process": "readonly",
169+
"Buffer": "readonly",
170+
"require": "readonly",
171+
"setTimeout": "readonly",
172+
"clearTimeout": "readonly",
173+
"setInterval": "readonly",
174+
"clearInterval": "readonly",
175+
"window": "readonly",
176+
"document": "readonly",
177+
"fetch": "readonly",
178+
"__dirname": "readonly",
179+
"__filename": "readonly"
180+
},
181+
"plugins": [
182+
"typescript",
183+
"import",
184+
"promise",
185+
"unicorn",
186+
"oxc"
187+
]
188+
},
189+
{
190+
"files": [
191+
"src/reactTopoViewer/**/*.ts",
192+
"src/reactTopoViewer/**/*.tsx"
193+
],
194+
"rules": {
195+
"max-lines": [
196+
"error",
197+
{
198+
"max": 3000,
199+
"skipBlankLines": true,
200+
"skipComments": true
201+
}
202+
]
203+
}
204+
},
205+
{
206+
"files": [
207+
"src/reactTopoViewer/webview/**/*.tsx",
208+
"src/topoViewer/**/*.tsx"
209+
],
210+
"rules": {
211+
"react/display-name": "error",
212+
"react/jsx-key": "error",
213+
"react/jsx-no-comment-textnodes": "error",
214+
"react/jsx-no-duplicate-props": "error",
215+
"react/jsx-no-target-blank": "error",
216+
"react/jsx-no-undef": "error",
217+
"react/button-has-type": "error",
218+
"react/iframe-missing-sandbox": "error",
219+
"react/no-children-prop": "error",
220+
"react/no-danger": "warn",
221+
"react/no-danger-with-children": "error",
222+
"jsx-a11y/label-has-associated-control": "error",
223+
"jsx-a11y/click-events-have-key-events": "warn",
224+
"jsx-a11y/no-static-element-interactions": "warn",
225+
"jsx-a11y/no-noninteractive-tabindex": "error",
226+
"jsx-a11y/tabindex-no-positive": "error",
227+
"react/no-direct-mutation-state": "error",
228+
"react/no-find-dom-node": "error",
229+
"react/no-is-mounted": "error",
230+
"react/no-render-return-value": "error",
231+
"react/no-string-refs": "error",
232+
"react/no-unescaped-entities": "error",
233+
"react/no-unknown-property": "error",
234+
"react/no-unsafe": "off",
235+
"react/react-in-jsx-scope": "off",
236+
"react-hooks/rules-of-hooks": "error",
237+
"react-hooks/exhaustive-deps": "warn",
238+
"react-perf/jsx-no-jsx-as-prop": "off",
239+
"react-perf/jsx-no-new-array-as-prop": "off",
240+
"react-perf/jsx-no-new-function-as-prop": "off",
241+
"react-perf/jsx-no-new-object-as-prop": "off",
242+
"react/jsx-no-constructed-context-values": "error",
243+
"react/forward-ref-uses-ref": "error",
244+
"react/checked-requires-onchange-or-readonly": "error",
245+
"react/jsx-no-useless-fragment": "warn"
246+
},
247+
"plugins": [
248+
"react",
249+
"jsx-a11y",
250+
"react-perf"
251+
]
252+
},
253+
{
254+
"files": [
255+
"src/reactTopoViewer/webview/components/canvas/**/*.tsx",
256+
"src/reactTopoViewer/webview/AppContent.tsx"
257+
],
258+
"rules": {
259+
"react-perf/jsx-no-new-array-as-prop": "warn",
260+
"react-perf/jsx-no-new-function-as-prop": "warn"
261+
},
262+
"plugins": [
263+
"react-perf"
264+
]
265+
},
266+
{
267+
"files": [
268+
"src/reactTopoViewer/webview/components/**/*.tsx"
269+
],
270+
"rules": {
271+
"unicorn/filename-case": [
272+
"error",
273+
{
274+
"case": "pascalCase"
275+
}
276+
]
277+
},
278+
"plugins": [
279+
"unicorn"
280+
]
281+
},
282+
{
283+
"files": [
284+
"src/reactTopoViewer/webview/hooks/**/*.ts"
285+
],
286+
"rules": {
287+
"unicorn/filename-case": [
288+
"error",
289+
{
290+
"case": "camelCase",
291+
"ignore": [
292+
"^index\\.ts$"
293+
]
294+
}
295+
]
296+
},
297+
"plugins": [
298+
"unicorn"
299+
]
300+
},
301+
{
302+
"files": [
303+
"test/**/*.ts",
304+
"test/**/*.tsx",
305+
"**/*.test.ts",
306+
"**/*.test.tsx"
307+
],
308+
"rules": {
309+
"@typescript-eslint/no-explicit-any": "off",
310+
"@typescript-eslint/no-unsafe-assignment": "off",
311+
"@typescript-eslint/no-unsafe-argument": "off",
312+
"@typescript-eslint/no-unsafe-member-access": "off",
313+
"@typescript-eslint/no-unsafe-call": "off",
314+
"@typescript-eslint/no-unsafe-return": "off",
315+
"@typescript-eslint/no-unsafe-type-assertion": "off",
316+
"no-console": "off",
317+
"no-unused-expressions": "off"
318+
},
319+
"plugins": [
320+
"typescript"
321+
]
322+
}
323+
]
324+
}

packages/ui/src/explorer/containerlabExplorerView.webview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,7 @@ export function ContainerlabExplorerView() {
17611761
handleErrorMessage(message);
17621762
return;
17631763
default:
1764-
return;
1764+
break;
17651765
}
17661766
}, [handleErrorMessage, handleFilterStateMessage, handleSnapshotMessage, handleUiStateMessage])
17671767
);

test/e2e/specs/full-workflow.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ async function clickNode(page: Page, nodeId: string): Promise<void> {
2424
if (!box) throw new Error(`Node ${nodeId} has no bounding box`);
2525
await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);
2626
await page.waitForTimeout(300);
27-
return;
2827
} catch {
2928
// Fallback: select directly through dev API when DOM node is off-viewport or not mounted yet.
3029
await page.evaluate((id) => {

0 commit comments

Comments
 (0)