diff --git a/package.json b/package.json index 07f2e4b..2716dee 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@typescript-eslint/parser": "5.29.0", "builtin-modules": "3.3.0", "esbuild": "0.14.47", + "eslint": "^8.29.0", "jest": "^28.1.1", "monkey-around": "^2.3.0", "obsidian": "^0.15.4", diff --git a/src/custom-sort/custom-sort.ts b/src/custom-sort/custom-sort.ts index 8b7ee46..91d7b1b 100644 --- a/src/custom-sort/custom-sort.ts +++ b/src/custom-sort/custom-sort.ts @@ -1,4 +1,4 @@ -import {FrontMatterCache, MetadataCache, requireApiVersion, TAbstractFile, TFile, TFolder} from 'obsidian'; +import {FrontMatterCache, requireApiVersion, TAbstractFile, TFile, TFolder} from 'obsidian'; import { CustomSortGroup, CustomSortGroupType, diff --git a/src/main.ts b/src/main.ts index ebd79dc..26112cb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -84,10 +84,11 @@ export default class CustomSortPlugin extends Plugin { // - files with the same name as parent folders (aka folder notes): References/References.md // - the file explicitly indicated in documentation, by default Inbox/Inbox.md if (aFile.name === SORTSPEC_FILE_NAME || + aFile.name === `${SORTSPEC_FILE_NAME}.md` || aFile.basename === parent.name || aFile.basename === this.settings.additionalSortspecFile || // (A) 'Inbox/sort' === setting 'Inbox/sort' aFile.path === this.settings.additionalSortspecFile || // (B) 'Inbox/sort.md' === setting 'Inbox/sort.md' - aFile.path === this.settings.additionalSortspecFile + '.md' // (C) 'Inbox/sort.md.md' === setting 'Inbox/sort.md' + aFile.path === `${this.settings.additionalSortspecFile}.md` // (C) 'Inbox/sort.md.md' === setting 'Inbox/sort.md' ) { const sortingSpecTxt: string = mCache.getCache(aFile.path)?.frontmatter?.[SORTINGSPEC_YAML_KEY] if (sortingSpecTxt) {