Commit graph

20 commits

Author SHA1 Message Date
johnny1093
c476604d09 lint: replace remaining any-typed casts with proper types
Resolves the rest of the no-unsafe-* family by giving TypeScript
enough information instead of suppressing it:
- Extend the Obsidian module augmentation (types.ts) with
  App.commands.removeCommand and Vault.getConfig so util.tsx and
  main.ts no longer need @ts-ignore around them.
- Cast event.target to the concrete HTMLElement subtype at each
  DOM event handler that reads .value/.checked/.offsetWidth
  (ChangeableText, MacroBuilder, commandComponent) instead of
  @ts-ignore/@ts-expect-error.
- Cast JSON.parse() results to their known shape (MacroBuilder's
  macro clone, locales.test.ts's loadJson, main.ts's loadSettings)
  instead of letting `any` flow through.
- Drop menuManager's unusual `this: (_item: MenuItem) => void`
  parameter and the .call(this, ...) it required - the returned
  closure never reads `this`, so this was both unnecessary and,
  under this project's non-strict bind/call/apply typing, exactly
  why the arguments passed through untyped. Calling the method
  directly is equivalent and fully typed.
- Same root cause for MacroBuilderModal's this.close.bind(this) and
  executeMacro.test.ts's .bind() - replaced with equivalent
  non-bind forms.
- confirmDeleteModal/mobileModifyModal: inline the h(...) call into
  render() instead of round-tripping through an intermediately
  VNode-typed field, which is where preact's h() lost prop typing.
- vitest.config.ts-style import.meta.dirname swapped for
  fileURLToPath(import.meta.url) in eslint.config.mts, since the
  project's TS lib doesn't type import.meta.dirname.

Type-level only; no behavior change beyond what's already covered
by the two preceding commits.
2026-07-11 09:43:37 -04:00
johnny1093
8c08808823 fix: correct ribbon item matching and stray global app references
- leftRibbonManager was comparing i.name === i.name (always true)
  instead of i.name === pair.name when locating a ribbon item to
  recolor/remove, so items sharing an icon with a different-named
  command could be matched incorrectly. Now compares against pair.name.
- Replace two stray references to the global `app` with the plugin's
  own `app` reference (this.plugin.app / plugin.app), consistent with
  the rest of the codebase.
- Use Object.prototype.hasOwnProperty.call() instead of calling
  hasOwnProperty directly on values that may not inherit from
  Object.prototype.
- Import Command/PluginManifest in types.ts so the Obsidian module
  augmentation resolves them instead of relying on ambient globals.
- Drop a leftover console.log of an expected/benign cancellation
  error in the "Add command" menu action.
2026-07-11 09:26:19 -04:00
johnny1093
505d7d4956 lint: clean up stale eslint-disable directives
Removes eslint-disable comments left over from the pre-flat-config
setup that no longer suppress anything (mostly no-unused-vars on
unused function params, which typescript-eslint doesn't flag by
default) and adds required descriptions to the handful that are
still load-bearing. Also replaces an `as any` cast for the
text-formatting-toolbar third-party API with a locally-typed cast,
since disabling no-explicit-any isn't allowed by the obsidianmd
config. Comment/typing only, no behavior change.
2026-07-11 09:19:04 -04:00
John Morabito
31ea9c9c45 fix: resolve all ESLint errors across the codebase
- Remove unused imports (getIconIds, setIcon, exp, arrayMoveMutable, etc.)
- Add missing explicit return types on functions and arrow functions
- Add public accessibility modifier to PageHeaderManager.buttons
- Fix mixed spaces/tabs in constants.ts and commandComponent.tsx
- Wrap case block declaration in MacroBuilder.tsx to fix no-case-declarations
- Add eslint-disable comments for false-positive no-unused-vars on
  function type annotation parameter names and TypeScript enum members
- Remove dead forceUpdate reference in MacroBuilder.tsx (was referencing
  this in a function component)

Reduces from 64 errors + 2 warnings to 0 errors + 2 warnings (the remaining
warnings are intentional non-null assertions).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 20:55:23 -04:00
quorafind
6603ae9dc5 chore: update version 2024-10-11 09:16:41 +08:00
Phillip Bronzel
3c717a05e0 feat: add missing features after 1.1.0 update + fix left ribbon, close #57, close #62 2022-12-20 22:46:36 +01:00
Phillip Bronzel
94832d2359 feat: add color picker to commands, close #46 2022-11-29 21:04:11 +01:00
phibr0
e717efa97e Fix compatibility with Obsidian 0.16.0 2022-08-31 10:37:01 +02:00
phibr0
06982078e8 Add slider for custom spacing between commands (koalas plugin) 2022-07-23 15:32:41 +02:00
phibr0
5753840f54 Handle removed commands in the settings 2022-07-19 11:05:42 +02:00
phibr0
0e870e1b7d Implement joethei's feedback 2022-07-16 11:24:50 +02:00
phibr0
b3850369fb Implement v1 checklist feedback 2022-07-13 21:47:57 +02:00
phibr0
fee8bac105 Add new Icon for "all devices" option 2022-07-12 17:20:14 +02:00
phibr0
9eb5d50680 Improve mobile UX, Add new Modal for touchscreen flow 2022-07-12 11:34:00 +02:00
phibr0
a143c33bb5 Optimize mobile UX 2022-07-12 00:07:28 +02:00
phibr0
d599811d8d Add translations among smaller fixes 2022-07-05 15:10:05 +02:00
phibr0
c655cfffd6 Hide commands of other devices, fix support button not working on mobile because of electron dependency 2022-07-05 10:26:42 +02:00
phibr0
d9a69e0c26 Commands for specific devices/device-types 2022-07-04 20:59:29 +02:00
phibr0
995baf96ef Delete, rename and change icon by right-clicking and in the settings 2022-06-13 11:31:03 +02:00
phibr0
47b125c43c Publish first BRAT-Release 2022-06-06 18:29:14 +02:00