mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-06-03 21:12:57 +00:00
(chore): tidied tsconfig and eslint, and some incorrect imports
This commit is contained in:
+41
-30
@@ -6,37 +6,41 @@ import * as sveltePlugin from "eslint-plugin-svelte";
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores([
|
||||
"**/node_modules/*",
|
||||
"**/jest.config.js",
|
||||
// Build outputs and legacy files
|
||||
"**/build",
|
||||
"**/main.js",
|
||||
"**/.eslintrc.js.bak",
|
||||
// Files from linked dependencies (those files should not exist for most people).
|
||||
"modules/octagonal-wheels/dist/**/*",
|
||||
|
||||
// Sub-projects (Exclude from root linting as they have different environments)
|
||||
"src/apps/**/*",
|
||||
|
||||
// Specific exclusions from common library (src/lib)
|
||||
"src/lib/coverage",
|
||||
"src/lib/browsertest",
|
||||
"**/test.ts",
|
||||
"**/tests.ts",
|
||||
"**/**test.ts",
|
||||
"**/**.test.ts",
|
||||
"**/*.unit.spec.ts",
|
||||
"**/esbuild.*.mjs",
|
||||
"**/terser.*.mjs",
|
||||
"**/node_modules",
|
||||
"**/build",
|
||||
"**/.eslintrc.js.bak",
|
||||
"src/lib/src/patches/pouchdb-utils",
|
||||
"**/esbuild.config.mjs",
|
||||
"**/rollup.config.js",
|
||||
"modules/octagonal-wheels/rollup.config.js",
|
||||
"modules/octagonal-wheels/dist/**/*",
|
||||
"src/lib/test",
|
||||
"src/lib/_tools",
|
||||
"src/lib/src/patches/pouchdb-utils",
|
||||
"src/lib/src/cli",
|
||||
"**/main.js",
|
||||
"src/apps/**/*",
|
||||
".prettierrc.*.mjs",
|
||||
".prettierrc.mjs",
|
||||
"*.config.mjs",
|
||||
"src/apps/**/*",
|
||||
"src/lib/src/services/implements/browser/**",
|
||||
"src/lib/src/services/implements/headless/**",
|
||||
"src/lib/src/API",
|
||||
|
||||
// Config files and build scripts
|
||||
"**/jest.config.js",
|
||||
"**/rollup.config.js",
|
||||
"**/esbuild.config.mjs",
|
||||
"**/terser.*.mjs",
|
||||
".prettierrc.*.mjs",
|
||||
".prettierrc.mjs",
|
||||
"*.config.mjs",
|
||||
|
||||
// Testing files (Simplified patterns)
|
||||
"**/*.test.ts",
|
||||
"**/*.unit.spec.ts",
|
||||
"**/test.ts",
|
||||
"**/tests.ts",
|
||||
]),
|
||||
...sveltePlugin.configs["flat/base"],
|
||||
...obsidianmd.configs.recommended,
|
||||
@@ -50,22 +54,29 @@ export default defineConfig([
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Base rules (turned off in favour of TS specific versions or explicitly disabled).
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["error", { args: "none" }],
|
||||
"no-unused-labels": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
"require-await": "off",
|
||||
|
||||
// TypeScript specific rules
|
||||
"@typescript-eslint/no-unused-vars": ["error", { args: "none" }],
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"require-await": "error",
|
||||
"obsidianmd/rule-custom-message": "off", // Temporary
|
||||
"obsidianmd/ui/sentence-case": "off", // Temporary
|
||||
"@typescript-eslint/require-await": "warn",
|
||||
"@typescript-eslint/no-misused-promises": "warn",
|
||||
"@typescript-eslint/no-floating-promises": "warn",
|
||||
"no-async-promise-executor": "warn",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
||||
|
||||
// General rules
|
||||
"no-async-promise-executor": "warn",
|
||||
"no-constant-condition": ["error", { checkLoops: false }],
|
||||
|
||||
// Plugin specific overrides (Pending review)
|
||||
"obsidianmd/rule-custom-message": "off",
|
||||
"obsidianmd/ui/sentence-case": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -77,7 +88,7 @@ export default defineConfig([
|
||||
},
|
||||
rules: {
|
||||
"no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
|
||||
"obsidianmd/no-plugin-as-component": "off", // Temporary
|
||||
"obsidianmd/no-plugin-as-component": "off",
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -68,7 +68,7 @@ import { ConflictResolveModal } from "../../modules/features/InteractiveConflict
|
||||
import { Semaphore } from "octagonal-wheels/concurrency/semaphore";
|
||||
import { EVENT_REQUEST_OPEN_PLUGIN_SYNC_DIALOG, eventHub } from "../../common/events.ts";
|
||||
import { PluginDialogModal } from "./PluginDialogModal.ts";
|
||||
import { $msg } from "src/lib/src/common/i18n.ts";
|
||||
import { $msg } from "@/lib/src/common/i18n.ts";
|
||||
import type { InjectableServiceHub } from "../../lib/src/services/InjectableServices.ts";
|
||||
import type { LiveSyncCore } from "../../main.ts";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { WorkspaceLeaf } from "@/deps.ts";
|
||||
import LogPaneComponent from "./LogPane.svelte";
|
||||
import type ObsidianLiveSyncPlugin from "../../../main.ts";
|
||||
import { SvelteItemView } from "../../../common/SvelteItemView.ts";
|
||||
import { $msg } from "src/lib/src/common/i18n.ts";
|
||||
import { $msg } from "@lib/common/i18n.ts";
|
||||
import { mount } from "svelte";
|
||||
export const VIEW_TYPE_LOG = "log-log";
|
||||
//Log view
|
||||
|
||||
@@ -29,7 +29,7 @@ import { addIcon, debounce, normalizePath, Notice, stringifyYaml, type Workspace
|
||||
import { LOG_LEVEL_NOTICE, setGlobalLogFunction } from "octagonal-wheels/common/logger";
|
||||
import { LogPaneView, VIEW_TYPE_LOG } from "./Log/LogPaneView.ts";
|
||||
import { serialized } from "octagonal-wheels/concurrency/lock";
|
||||
import { $msg } from "src/lib/src/common/i18n.ts";
|
||||
import { $msg } from "@lib/common/i18n.ts";
|
||||
import { P2PLogCollector } from "@/lib/src/replication/trystero/P2PLogCollector.ts";
|
||||
import type { LiveSyncCore } from "../../main.ts";
|
||||
import { LiveSyncError } from "@lib/common/LSError.ts";
|
||||
|
||||
@@ -8,12 +8,7 @@ import {
|
||||
type ValueComponent,
|
||||
} from "@/deps.ts";
|
||||
import { unique } from "octagonal-wheels/collection";
|
||||
import {
|
||||
LEVEL_ADVANCED,
|
||||
LEVEL_POWER_USER,
|
||||
statusDisplay,
|
||||
type ConfigurationItem,
|
||||
} from "../../../lib/src/common/types.ts";
|
||||
import { LEVEL_ADVANCED, LEVEL_POWER_USER, statusDisplay, type ConfigurationItem } from "@lib/common/types.ts";
|
||||
import { createStub, type ObsidianLiveSyncSettingTab } from "./ObsidianLiveSyncSettingTab.ts";
|
||||
import {
|
||||
type AllSettingItemKey,
|
||||
@@ -23,7 +18,7 @@ import {
|
||||
type AllNumericItemKey,
|
||||
type AllBooleanItemKey,
|
||||
} from "./settingConstants.ts";
|
||||
import { $msg } from "src/lib/src/common/i18n.ts";
|
||||
import { $msg } from "@lib/common/i18n.ts";
|
||||
import { findAttrFromParent, wrapMemo, type AutoWireOption, type OnUpdateResult } from "./SettingPane.ts";
|
||||
|
||||
export class LiveSyncSetting extends Setting {
|
||||
|
||||
+2
-3
@@ -2,7 +2,6 @@
|
||||
"extends": "@tsconfig/svelte/tsconfig.json",
|
||||
"inlineSourceMap": true,
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"module": "ESNext",
|
||||
"target": "ES2018",
|
||||
"allowJs": true,
|
||||
@@ -20,8 +19,8 @@
|
||||
"strictBindCallApply": true,
|
||||
"strictFunctionTypes": true,
|
||||
"paths": {
|
||||
"@/*": ["src/*"],
|
||||
"@lib/*": ["src/lib/src/*"]
|
||||
"@/*": ["./src/*"],
|
||||
"@lib/*": ["./src/lib/src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["**/*.ts", "test/**/*.test.ts", "**/*.unit.spec.ts"],
|
||||
|
||||
Reference in New Issue
Block a user