projects
/
dotfiles
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update .bashrc
[dotfiles/.git]
/
.config
/
coc
/
extensions
/
node_modules
/
coc-prettier
/
node_modules
/
eslint
/
lib
/
rules
/
no-alert.js
diff --git
a/.config/coc/extensions/node_modules/coc-prettier/node_modules/eslint/lib/rules/no-alert.js
b/.config/coc/extensions/node_modules/coc-prettier/node_modules/eslint/lib/rules/no-alert.js
index 287cd2c35701f0a2498e90160ad3ace62343960c..702b4d2ba7cccf1ddea02bc10b4168534f0bc7e0 100644
(file)
--- a/
.config/coc/extensions/node_modules/coc-prettier/node_modules/eslint/lib/rules/no-alert.js
+++ b/
.config/coc/extensions/node_modules/coc-prettier/node_modules/eslint/lib/rules/no-alert.js
@@
-8,7
+8,11
@@
// Requirements
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
-const getPropertyName = require("./utils/ast-utils").getStaticPropertyName;
+const {
+ getStaticPropertyName: getPropertyName,
+ getVariableByName,
+ skipChainExpression
+} = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
// Helpers
@@
-61,7
+65,13
@@
function isGlobalThisReferenceOrGlobalWindow(scope, node) {
if (scope.type === "global" && node.type === "ThisExpression") {
return true;
}
if (scope.type === "global" && node.type === "ThisExpression") {
return true;
}
- if (node.name === "window") {
+ if (
+ node.type === "Identifier" &&
+ (
+ node.name === "window" ||
+ (node.name === "globalThis" && getVariableByName(scope, "globalThis"))
+ )
+ ) {
return !isShadowed(scope, node);
}
return !isShadowed(scope, node);
}
@@
-93,7
+103,7
@@
module.exports = {
create(context) {
return {
CallExpression(node) {
create(context) {
return {
CallExpression(node) {
- const callee =
node.callee
,
+ const callee =
skipChainExpression(node.callee)
,
currentScope = context.getScope();
// without window.
currentScope = context.getScope();
// without window.
@@
-119,7
+129,6
@@
module.exports = {
});
}
}
});
}
}
-
}
};
}
};