Chore: update ESLint config

This commit is contained in:
SukkaW
2023-09-29 02:32:28 +08:00
parent ac2f5d56a9
commit 970e4dcc85
10 changed files with 197 additions and 31 deletions

View File

@@ -19,9 +19,9 @@ const CLASH_SUPPORTED_RULE_TYPE = [
*/
const surgeRulesetToClashClassicalTextRuleset = (rules) => {
const trie = Trie.from(rules);
return CLASH_SUPPORTED_RULE_TYPE.map(
return CLASH_SUPPORTED_RULE_TYPE.flatMap(
type => trie.find(`${type},`)
).flat();
);
};
module.exports.surgeRulesetToClashClassicalTextRuleset = surgeRulesetToClashClassicalTextRuleset;

View File

@@ -15,6 +15,7 @@ const domainDeduper = (inputDomains) => {
}
// delete all included subdomains (ends with `.example.com`)
// eslint-disable-next-line sukka/unicorn/no-array-method-this-argument -- it is not an array
trie.find(d, false).forEach(f => sets.delete(f));
// if `.example.com` exists, then `example.com` should also be removed

View File

@@ -2,7 +2,7 @@
* Suffix Trie based on Mnemonist Trie
*/
const SENTINEL = String.fromCharCode(0);
const SENTINEL = String.fromCodePoint(0);
/**
* @param {string[] | Set<string>} [from]