Fix ObsidianReviewBot required changes#28
Merged
Conversation
Spread `obsidianmd.configs.recommended` at array level for its full opinionated ruleset, replacing the standalone `eslint-plugin-import` dependency. Add `no-else-return`, `no-sequences`, `prefer-template`, `no-param-reassign`, `object-shorthand`, `no-shadow`, `prefer-nullish-coalescing`, `prefer-optional-chain`, `prefer-readonly`, `return-await`, and `switch-exhaustiveness-check`. Scope unicorn to JS/TS files only.
- Replace as type assertions with Zod schema validation - Mark class properties readonly; use ?. optional chaining; use template literals - Fix UI text to sentence case - Update deprecated Zod APIs (`z.url()`, `z.iso.datetime()`) - Add `eslint-disable` for legitimate exceptions (`node:` imports, `fetch`, inline styles) - Add test-specific ESLint overrides (`no-unsafe-*`, `no-shadow`, `unbound-method`, `no-tfile-tfolder-cast`) - Replace `builtin-modules/dotenv` with Node.js built-ins; fix `node:`-prefixed externals - Remove unused `eslint-import-resolver-typescript`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopt the full
eslint-plugin-obsidianmdrecommended config to address ObsidianReviewBot required changes, add stricter rules, and fix all resulting lint errors.Note
Medium Risk
Primarily a tooling/linting PR, but it touches OAuth refresh error handling, sync metadata parsing, and build-time env loading, which could affect runtime behavior if schemas or parsing assumptions are wrong.
Overview
Updates build and lint tooling to satisfy ObsidianReviewBot requirements by switching to Node’s
process.loadEnvFile()andnode:modulebuiltinModules, and by adoptingeslint-plugin-obsidianmd’s recommended flat config (plus stricter TypeScript/Unicorn/base rules) while dropping the previousimportresolver setup.Fixes the resulting code issues across the plugin: makes many fields
readonly, tightens JSON parsing tounknown+ Zod validation (including newgoogleErrorResponseSchemafor OAuth error responses and reuse ofparsedLineSchemawhen reading/writing embedded task metadata), updates Zod schema helpers in Google Tasks response validation, and adjusts UI text/scripts/tests with targeted eslint disables for product-name sentence case and allowed Node/builtinfetchusage.Written by Cursor Bugbot for commit ab2206b. This will update automatically on new commits. Configure here.