Skip to content

Commit

Permalink
Address feedback from Obsidian.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextoumbourou committed Jan 22, 2025
1 parent 53b3352 commit 8e9fb09
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 189 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint'
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
env: {
node: true,
jest: true
},
rules: {
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'warn',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'semi': ['error', 'always'],
'quotes': ['error', 'single']
}
};
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ jobs:
run: npm ci

- name: Run tests
run: npm test
run: npm test

- name: Run linting
run: npm run lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ node_modules

main.js
main.test.js
obsidian.js
13 changes: 8 additions & 5 deletions __mocks__/obsidian.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export class Plugin {
app: any;
registerEvent(_: any) {}
addCommand(_: any) {}
app: unknown;
}

export class TFile {
Expand All @@ -25,7 +23,7 @@ export interface HeadingCache {

export interface FrontMatterCache {
title?: string;
[key: string]: any;
[key: string]: unknown;
}

export interface CachedMetadata {
Expand All @@ -41,12 +39,17 @@ export interface CachedMetadata {
frontmatter?: FrontMatterCache;
}

export function debounce(func: Function, timeout: number, immediate?: boolean) {
export function debounce(
func: (...args: unknown[]) => unknown,
_timeout: number,
_immediate?: boolean
) {
return func;
}

export class Notice {
constructor(message: string) {
// eslint-disable-next-line no-console
console.log(message);
}
}
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the Title As Link Text plugin will be documented in this file.

## [1.1.4] - 🚀 Release version

- Mainly just a code cleanup, and ensuring the all platforms are supported.

## [1.1.3] - 🐛 Bug Fix

### Fixed
Expand Down
Loading

0 comments on commit 8e9fb09

Please sign in to comment.