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:
Saq Imtiaz
2026-02-20 09:38:42 +01:00
committed by GitHub
parent 08f2b8bdf4
commit 785086e0a5
270 changed files with 3827 additions and 3970 deletions

View File

@@ -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;
}