Skip to content

⬅️ Back to Table of Contents

📄 no-unsafe-function-type.ts

📊 Analysis Summary

Metric Count
🔧 Functions 1
📦 Imports 4

📚 Table of Contents

🛠️ File Location:

📂 packages/eslint-plugin/src/rules/no-unsafe-function-type.ts

📦 Imports

Name Source
TSESTree @typescript-eslint/utils
AST_NODE_TYPES @typescript-eslint/utils
createRule ../util
isReferenceToGlobalFunction ../util

Functions

checkBannedTypes(node: TSESTree.Node): void

Code
function checkBannedTypes(node: TSESTree.Node): void {
      if (
        node.type === AST_NODE_TYPES.Identifier &&
        node.name === 'Function' &&
        isReferenceToGlobalFunction('Function', node, context.sourceCode)
      ) {
        context.report({
          node,
          messageId: 'bannedFunctionType',
        });
      }
    }
  • Parameters:
  • node: TSESTree.Node
  • Return Type: void
  • Calls:
  • isReferenceToGlobalFunction (from ../util)
  • context.report