initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
34
github/codeql-action-v2/node_modules/eslint-plugin-no-async-foreach/lib/no-async-foreach.js
generated
vendored
Normal file
34
github/codeql-action-v2/node_modules/eslint-plugin-no-async-foreach/lib/no-async-foreach.js
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/**
|
||||
* @fileoverview Blah
|
||||
* @author El
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
module.exports = {
|
||||
create: function(context) {
|
||||
|
||||
return {
|
||||
ExpressionStatement: function(node) {
|
||||
const { callee } = node.expression
|
||||
if (!callee || !callee.property || !callee.property.name) return;
|
||||
if (callee.property.name === "forEach") {
|
||||
const functionArguments = node.expression.arguments.find(n => {
|
||||
return n.type === 'ArrowFunctionExpression' || n.type === 'FunctionExpression'
|
||||
})
|
||||
if(functionArguments){
|
||||
if (functionArguments.async) {
|
||||
context.report(node, "No async function in forEachs");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue