mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:10:44 +00:00
chore(lint): enable warning comments rule
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
"eslint/no-await-in-loop": "off",
|
||||
"eslint/no-new": "error",
|
||||
"eslint/no-shadow": "off",
|
||||
"eslint/no-warning-comments": "error",
|
||||
"eslint/no-unmodified-loop-condition": "error",
|
||||
"eslint-plugin-unicorn/prefer-set-size": "error",
|
||||
"oxc/no-accumulating-spread": "error",
|
||||
@@ -51,6 +52,12 @@
|
||||
"**/node_modules/**"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["src/security/**"],
|
||||
"rules": {
|
||||
"eslint/no-warning-comments": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"**/*.test.ts",
|
||||
|
||||
@@ -32,7 +32,7 @@ describe("telegram stickers", () => {
|
||||
describeStickerImageSpy.mockReturnValue(undefined);
|
||||
});
|
||||
|
||||
// TODO #50185: re-enable once deterministic static sticker fetch injection is in place.
|
||||
// Skipped pending #50185: deterministic static sticker fetch injection.
|
||||
it.skip(
|
||||
"downloads static sticker (WEBP) and includes sticker metadata",
|
||||
async () => {
|
||||
@@ -75,7 +75,7 @@ describe("telegram stickers", () => {
|
||||
STICKER_TEST_TIMEOUT_MS,
|
||||
);
|
||||
|
||||
// TODO #50185: re-enable with deterministic cache-refresh assertions in CI.
|
||||
// Skipped pending #50185: deterministic cache-refresh assertions in CI.
|
||||
it.skip(
|
||||
"refreshes cached sticker metadata on cache hit",
|
||||
async () => {
|
||||
|
||||
@@ -103,48 +103,49 @@ function resolveWorkspacePackageDir(packageName: string): string {
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Test loaders use caller-supplied module surface types.
|
||||
export function loadBundledPluginPublicSurfaceSync<T extends object>(params: {
|
||||
type BundledPluginPublicSurfaceLoader = <T extends object>(params: {
|
||||
pluginId: string;
|
||||
artifactBasename: string;
|
||||
}): T {
|
||||
}) => T;
|
||||
|
||||
// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Test loaders use caller-supplied module surface types.
|
||||
type BundledPluginPublicArtifactLoader = <T extends object>(pluginId: string) => T;
|
||||
|
||||
export const loadBundledPluginPublicSurfaceSync: BundledPluginPublicSurfaceLoader = (params) => {
|
||||
const metadata = findBundledPluginMetadata(params.pluginId);
|
||||
return loadBundledPluginPublicSurfaceModuleSync<T>({
|
||||
return loadBundledPluginPublicSurfaceModuleSync({
|
||||
dirName: metadata.dirName,
|
||||
artifactBasename: normalizeBundledPluginArtifactSubpath(params.artifactBasename),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Test loaders use caller-supplied module surface types.
|
||||
export function loadBundledPluginApiSync<T extends object>(pluginId: string): T {
|
||||
return loadBundledPluginPublicSurfaceSync<T>({
|
||||
export const loadBundledPluginApiSync: BundledPluginPublicArtifactLoader = (pluginId) => {
|
||||
return loadBundledPluginPublicSurfaceSync({
|
||||
pluginId,
|
||||
artifactBasename: "api.js",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Test loaders use caller-supplied module surface types.
|
||||
export function loadBundledPluginContractApiSync<T extends object>(pluginId: string): T {
|
||||
return loadBundledPluginPublicSurfaceSync<T>({
|
||||
export const loadBundledPluginContractApiSync: BundledPluginPublicArtifactLoader = (pluginId) => {
|
||||
return loadBundledPluginPublicSurfaceSync({
|
||||
pluginId,
|
||||
artifactBasename: "contract-api.js",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Test loaders use caller-supplied module surface types.
|
||||
export function loadBundledPluginRuntimeApiSync<T extends object>(pluginId: string): T {
|
||||
return loadBundledPluginPublicSurfaceSync<T>({
|
||||
export const loadBundledPluginRuntimeApiSync: BundledPluginPublicArtifactLoader = (pluginId) => {
|
||||
return loadBundledPluginPublicSurfaceSync({
|
||||
pluginId,
|
||||
artifactBasename: "runtime-api.js",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Test loaders use caller-supplied module surface types.
|
||||
export function loadBundledPluginTestApiSync<T extends object>(pluginId: string): T {
|
||||
return loadBundledPluginPublicSurfaceSync<T>({
|
||||
export const loadBundledPluginTestApiSync: BundledPluginPublicArtifactLoader = (pluginId) => {
|
||||
return loadBundledPluginPublicSurfaceSync({
|
||||
pluginId,
|
||||
artifactBasename: "test-api.js",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export function resolveBundledPluginPublicModulePath(params: {
|
||||
pluginId: string;
|
||||
|
||||
@@ -151,10 +151,7 @@ export function createSetupWizardAdapter(params: SetupWizardAdapterParams) {
|
||||
return buildChannelSetupWizardAdapterFromSetupWizard(params);
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Test helper preserves plugin-specific setup wizard surface type.
|
||||
export function createPluginSetupWizardAdapter<TPlugin extends SetupWizardTestPlugin>(
|
||||
plugin: TPlugin,
|
||||
) {
|
||||
export function createPluginSetupWizardAdapter(plugin: SetupWizardTestPlugin) {
|
||||
const wizard = requireDeclarativeSetupWizard(plugin);
|
||||
return createSetupWizardAdapter({
|
||||
plugin: plugin as unknown as SetupWizardPlugin,
|
||||
@@ -162,17 +159,11 @@ export function createPluginSetupWizardAdapter<TPlugin extends SetupWizardTestPl
|
||||
});
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Test helper preserves plugin-specific setup wizard surface type.
|
||||
export function createPluginSetupWizardConfigure<TPlugin extends SetupWizardTestPlugin>(
|
||||
plugin: TPlugin,
|
||||
) {
|
||||
export function createPluginSetupWizardConfigure(plugin: SetupWizardTestPlugin) {
|
||||
return createPluginSetupWizardAdapter(plugin).configure;
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Test helper preserves plugin-specific setup wizard surface type.
|
||||
export function createPluginSetupWizardStatus<TPlugin extends SetupWizardTestPlugin>(
|
||||
plugin: TPlugin,
|
||||
) {
|
||||
export function createPluginSetupWizardStatus(plugin: SetupWizardTestPlugin) {
|
||||
return createPluginSetupWizardAdapter(plugin).getStatus;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,16 +79,54 @@ describe("production lint suppressions", () => {
|
||||
it("keeps the intentional production suppression tail on an explicit allowlist", () => {
|
||||
expect(summarizeSuppressions(collectProductionLintSuppressions())).toEqual([
|
||||
"extensions/browser/src/browser/pw-tools-core.interactions.ts|@typescript-eslint/no-implied-eval|2",
|
||||
"extensions/browser/src/cli/browser-cli-actions-input/register.files-downloads.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"extensions/browser/src/node-host/invoke-browser.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"extensions/discord/src/monitor.tool-result.test-helpers.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"extensions/discord/src/outbound-adapter.test-harness.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"extensions/discord/src/test-support/provider.test-support.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"extensions/feishu/src/bitable.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"extensions/matrix/src/onboarding.test-harness.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"extensions/slack/src/monitor/provider.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"scripts/e2e/mcp-channels-harness.ts|unicorn/prefer-add-event-listener|1",
|
||||
"scripts/lib/extension-package-boundary.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"scripts/lib/plugin-npm-release.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/agents/agent-scope.ts|no-control-regex|1",
|
||||
"src/agents/pi-embedded-runner/run/images.ts|no-control-regex|1",
|
||||
"src/agents/skills-clawhub.ts|no-control-regex|1",
|
||||
"src/agents/subagent-attachments.ts|no-control-regex|1",
|
||||
"src/agents/subagent-spawn.ts|no-control-regex|1",
|
||||
"src/agents/tools/common.ts|typescript/no-explicit-any|1",
|
||||
"src/channels/plugins/channel-runtime-surface.types.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/channels/plugins/contracts/test-helpers.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/channels/plugins/types.plugin.ts|typescript/no-explicit-any|1",
|
||||
"src/cli/cli-utils.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/cli/command-options.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/cli/plugins-cli-test-helpers.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/cli/test-runtime-capture.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/config/types.channels.ts|@typescript-eslint/no-explicit-any|1",
|
||||
"src/gateway/test-helpers.server.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/hooks/module-loader.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/infra/channel-runtime-context.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/infra/exec-approvals-effective.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/infra/json-file.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/infra/outbound/send-deps.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/node-host/invoke.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/plugin-sdk/channel-config-helpers.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/plugin-sdk/channel-entry-contract.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/plugin-sdk/facade-loader.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/plugin-sdk/facade-runtime.ts|typescript/no-unnecessary-type-parameters|3",
|
||||
"src/plugin-sdk/qa-runner-runtime.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/plugins/hooks.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/plugins/lazy-service-module.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/plugins/public-surface-loader.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/plugins/runtime/runtime-channel.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/plugins/runtime/runtime-plugin-boundary.ts|typescript/no-unnecessary-type-parameters|2",
|
||||
"src/plugins/runtime/types-channel.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/tasks/task-flow-registry.store.sqlite.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/tasks/task-registry.store.sqlite.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"src/test-utils/bundled-plugin-public-surface.ts|typescript/no-unnecessary-type-parameters|2",
|
||||
"src/test-utils/vitest-mock-fn.ts|typescript/no-explicit-any|1",
|
||||
"src/utils.ts|typescript/no-unnecessary-type-parameters|1",
|
||||
"ui/src/ui/views/overview-log-tail.ts|no-control-regex|1",
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user