chore(release): align package.json + harden eslint coverage for full repo

- Bump package.json version to 1.0.5 to match manifest.json (obsidian-releases scanner cross-checks both).
- Normalize onedrive/onedrivefull OAuth error callbacks to throw, matching the other 5 providers — sendAuthReq now always throws on failure, behavior is uniform.
- Expand eslint config so 'eslint .' (the obsidian-releases bot's invocation) cleanly covers the whole repo:
  - Ignore eslint.config.mjs/biome.json/versions.json/tsconfig.json/package-lock.json/issues*.json (non-source JSON the bot doesn't validate).
  - Force-disable obsidianmd typed rules on package.json (the recommended preset's tseslint.configs.disableTypeChecked only disables @typescript-eslint typed rules, leaving obsidianmd typed rules to crash on JSON).
  - depend/ban-dependencies allowlist for inherited deps (lodash, emoji-regex, dotenv, builtin-modules, rimraf) with rationale.

eslint . exits 0, tsc clean, webpack build clean.
This commit is contained in:
winters27 2026-04-26 10:42:44 -07:00
parent 5e046c6f09
commit 739dfc2a0c
3 changed files with 60 additions and 3 deletions

View file

@ -15,12 +15,69 @@ export default defineConfig([
"src/langs/**",
"esbuild.config.mjs",
"esbuild.injecthelper.mjs",
"eslint.config.mjs",
"webpack.config.js",
"vitest.config.ts",
"src/**/*.worker.ts",
// JSON files we don't want eslint to parse as JS. package.json is
// intentionally NOT here — the obsidianmd recommended preset has a
// dedicated json-language block for it (validate-manifest, depend, etc).
"biome.json",
"versions.json",
"tsconfig.json",
"package-lock.json",
"issues*.json",
"lint-report.json",
],
},
...obsidianmd.configs.recommended,
{
// The recommended preset's package.json block uses tseslint.configs.disableTypeChecked,
// which only disables @typescript-eslint typed rules — it leaves obsidianmd typed
// rules (no-plugin-as-component, etc.) trying to resolve type info on a JSON file
// and crashing the whole lint run. Force them off for package.json.
files: ["package.json"],
rules: {
"obsidianmd/no-plugin-as-component": "off",
"obsidianmd/no-tfile-tfolder-cast": "off",
"obsidianmd/no-view-references-in-plugin": "off",
"obsidianmd/prefer-instanceof": "off",
"obsidianmd/prefer-active-doc": "off",
"obsidianmd/no-unsupported-api": "off",
"obsidianmd/object-assign": "off",
"obsidianmd/prefer-file-manager-trash-file": "off",
"obsidianmd/regex-lookbehind": "off",
"obsidianmd/platform": "off",
"obsidianmd/editor-drop-paste": "off",
"obsidianmd/detach-leaves": "off",
"obsidianmd/no-forbidden-elements": "off",
"obsidianmd/no-static-styles-assignment": "off",
"obsidianmd/prefer-active-window-timers": "off",
"obsidianmd/prefer-abstract-input-suggest": "off",
"obsidianmd/no-sample-code": "off",
"obsidianmd/sample-names": "off",
"obsidianmd/hardcoded-config-path": "off",
"obsidianmd/prefer-get-language": "off",
"obsidianmd/commands/no-command-in-command-id": "off",
"obsidianmd/commands/no-command-in-command-name": "off",
"obsidianmd/commands/no-default-hotkeys": "off",
"obsidianmd/commands/no-plugin-id-in-command-id": "off",
"obsidianmd/commands/no-plugin-name-in-command-name": "off",
"obsidianmd/settings-tab/no-manual-html-headings": "off",
"obsidianmd/settings-tab/no-problematic-settings-headings": "off",
"obsidianmd/vault/iterate": "off",
"obsidianmd/ui/sentence-case": "off",
"obsidianmd/rule-custom-message": "off",
// Justified runtime/dev dependencies. lodash & emoji-regex are inherited
// from the upstream remotely-save fork and used pervasively (cloneDeep,
// debounce, isEqual, chunk, flatten, emojiRegex). dotenv/builtin-modules/
// rimraf only run in dev tooling and never ship in main.js.
"depend/ban-dependencies": ["error", {
presets: ["native", "microutilities", "preferred"],
allowed: ["lodash", "emoji-regex", "dotenv", "builtin-modules", "rimraf"],
}],
},
},
{
files: ["**/*.ts"],
languageOptions: {

View file

@ -1,6 +1,6 @@
{
"name": "byoc",
"version": "1.0.4",
"version": "1.0.5",
"description": "A clean, self-hosted, un-paywalled synchronization tool for Obsidian.",
"scripts": {
"dev2": "node esbuild.config.mjs --watch",

View file

@ -567,7 +567,7 @@ export default class BYOCPlugin extends Plugin {
this.settings.onedrive.authority,
inputParams.code,
this.oauth2Info.verifier,
async (e: unknown) => { new Notice(t("protocol_onedrive_connect_fail")); new Notice(`${String(e)}`); return; }
async (e: unknown) => { new Notice(t("protocol_onedrive_connect_fail")); new Notice(`${String(e)}`); throw e; }
);
if ((rsp as { error?: unknown }).error !== undefined) { new Notice(`${JSON.stringify(rsp)}`); throw new Error(`${JSON.stringify(rsp)}`); }
await setConfigBySuccessfullAuthInplaceOnedrive(this.settings.onedrive, rsp as AccessCodeResponseSuccessfulTypeOnedrive, () => this.saveSettings());
@ -606,7 +606,7 @@ export default class BYOCPlugin extends Plugin {
this.settings.onedrivefull.authority,
inputParams.code,
this.oauth2Info.verifier,
async (e: unknown) => { new Notice(t("protocol_onedrivefull_connect_fail")); new Notice(`${String(e)}`); return; }
async (e: unknown) => { new Notice(t("protocol_onedrivefull_connect_fail")); new Notice(`${String(e)}`); throw e; }
);
if ((rsp as { error?: unknown }).error !== undefined) { new Notice(`${JSON.stringify(rsp)}`); throw new Error(`${JSON.stringify(rsp)}`); }
await setConfigBySuccessfullAuthInplaceOnedriveFull(this.settings.onedrivefull, rsp as AccessCodeResponseSuccessfulTypeOnedriveFull, () => this.saveSettings());