mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 20:41:46 +00:00
eslint: Fix unicorn/prefer-includes.
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-includes.md Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
b178fc6069
commit
fd11c9c666
@@ -1,5 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
const _ = require("lodash");
|
||||
|
||||
const requires = [];
|
||||
@@ -50,11 +52,10 @@ exports.clear_zulip_refs = function () {
|
||||
correctly, but it will fail if we
|
||||
run it standalone.
|
||||
*/
|
||||
const staticPath = path.resolve(__dirname, "../../static") + path.sep;
|
||||
_.each(require.cache, (_, fn) => {
|
||||
if (fn.indexOf("static/") >= 0) {
|
||||
if (fn.indexOf("static/templates") < 0) {
|
||||
delete require.cache[fn];
|
||||
}
|
||||
if (fn.startsWith(staticPath) && !fn.startsWith(staticPath + "templates" + path.sep)) {
|
||||
delete require.cache[fn];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user