File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ export default class LinterPlugin extends Plugin {
200200 return false ;
201201 }
202202
203- this . createFolderLintModal ( ctx . file . parent ) ;
203+ that . createFolderLintModal ( ctx . file . parent ) ;
204204 } ,
205205 } ) ;
206206
@@ -229,7 +229,7 @@ export default class LinterPlugin extends Plugin {
229229 return false ;
230230 }
231231
232- void this . addFolderToIgnoreList ( ctx . file . parent ) ;
232+ void that . addFolderToIgnoreList ( ctx . file . parent ) ;
233233 } ,
234234 } ) ;
235235
@@ -241,7 +241,7 @@ export default class LinterPlugin extends Plugin {
241241 return that . isMarkdownFile ( ctx . file ) && ! that . shouldIgnoreFile ( ctx . file ) ;
242242 }
243243
244- void this . addFileToIgnoreList ( ctx . file ) ;
244+ void that . addFileToIgnoreList ( ctx . file ) ;
245245 } ,
246246 icon : iconInfo . ignoreFile . id ,
247247 } ) ;
Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ import {
66 Option ,
77 BooleanOption ,
88} from './option' ;
9- import { YAMLException } from 'js-yaml' ;
109import { LinterError } from './linter-error' ;
1110import { getTextInLanguage , LanguageStringKey } from './lang/helpers' ;
1211import { ignoreListOfTypes , IgnoreType } from './utils/ignore-types' ;
1312import { LinterSettings } from './settings-data' ;
1413import { App } from 'obsidian' ;
14+ import { YAMLParseError } from 'yaml' ;
1515
1616export type Options = { [ optionName : string ] : any } ;
1717
@@ -188,12 +188,13 @@ export function sortRules(): void {
188188
189189export function wrapLintError ( error : Error , ruleName : string ) {
190190 let errorMessage : string ;
191- if ( error instanceof YAMLException ) {
191+ if ( error instanceof YAMLParseError ) {
192192 errorMessage = error . toString ( ) ;
193193 errorMessage = getTextInLanguage ( 'logs.wrapper-yaml-error' ) . replace ( '{ERROR_MESSAGE}' , errorMessage . substring ( errorMessage . indexOf ( ':' ) + 1 ) ) ;
194194 } else {
195195 errorMessage = getTextInLanguage ( 'logs.wrapper-unknown-error' ) . replace ( '{ERROR_MESSAGE}' , error . message ) ;
196196 }
197197
198+ // TODO: clean this up, and see about replacing encountered an with the appropriate getTextInLanguage
198199 throw new LinterError ( `"${ ruleName } " encountered an ${ errorMessage } ` , error ) ;
199200}
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ export function getPositions(type: MDAstTypes, text: string): Position[] {
117117 * @return {PositionPlusEmptyIndicator[] } The positions of the list item text in the given text
118118 * with a status as to whether or not they are empty
119119 */
120- function getListItemTextPositions ( text : string , includeEmptyNodes : boolean = false ) : Position [ ] {
120+ function getListItemTextPositions ( text : string , includeEmptyNodes : boolean = false ) : PositionPlusEmptyIndicator [ ] {
121121 const ast = parseTextToAST ( text ) ;
122122 const positions : PositionPlusEmptyIndicator [ ] = [ ] ;
123123 visit ( ast , MDAstTypes . ListItem as string , ( node ) => {
You can’t perform that action at this time.
0 commit comments