mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-25 21:54:36 +00:00
Fixes ESLint errors (#9668)
* fix: apply automatic eslint fixes * lint: allow hashbang comment for tiddlywiki.js * lint: first back of manual lint fixes for unused vars * lint: added more fixes for unused vars * lint: missed files * lint: updated eslint config with selected rules from #9669
This commit is contained in:
@@ -82,7 +82,7 @@ exports.TextMap.prototype.findText = function(targetString,targetPrefix,targetSu
|
||||
startOffset: startPos - startMetadata.start,
|
||||
endNode: endMetadata.domNode,
|
||||
endOffset: (startPos + targetString.length) - endMetadata.start
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -116,12 +116,12 @@ exports.TextMap.prototype.search = function(searchString,options) {
|
||||
} else if(options.mode === "whitespace") {
|
||||
// Normalise whitespace
|
||||
regExpString = "(" + searchString.split(/\s+/g).filter(function(word) {
|
||||
return !!word
|
||||
return !!word;
|
||||
}).map($tw.utils.escapeRegExp).join("\\s+") + ")";
|
||||
} else if(options.mode === "words" || options.mode === "some") {
|
||||
// Match any word separated by whitespace
|
||||
regExpString = "(" + searchString.split(/\s+/g).filter(function(word) {
|
||||
return !!word
|
||||
return !!word;
|
||||
}).map($tw.utils.escapeRegExp).join("|") + ")";
|
||||
} else {
|
||||
// Normal search
|
||||
@@ -164,8 +164,8 @@ Given a start container and offset and a search string, return a prefix and suff
|
||||
*/
|
||||
exports.TextMap.prototype.extractContext = function(startContainer,startOffset,text) {
|
||||
var startMetadata = this.metadata.find(function(metadata) {
|
||||
return metadata.domNode === startContainer
|
||||
});
|
||||
return metadata.domNode === startContainer;
|
||||
});
|
||||
if(!startMetadata) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user