Skip to content

⬅️ Back to Table of Contents

📄 debug-namespace.ts

📊 Analysis Summary

Metric Count
🔧 Functions 9
📦 Imports 3

📚 Table of Contents

🛠️ File Location:

📂 packages/eslint-plugin-internal/src/rules/debug-namespace.ts

📦 Imports

Name Source
TSESTree @typescript-eslint/utils
getStaticValue @typescript-eslint/utils/ast-utils
createRule ../util

Functions

filePathToNamespace(filePath: string): string

Code
function filePathToNamespace(filePath: string) {
  const relativePath = filePath
    .split(/packages[\\/]+/)
    .slice(1)
    .join('');

  const relativeNamespace = relativePath
    .replace(/^[\\/]/, '')
    .replace(/(?:dist|lib|src)(\/|\\)/, '')
    .replace(/\.\w+$/, '')
    .replaceAll(/[^a-z0-9-]+/gi, ':');

  return `typescript-eslint:${relativeNamespace}`;
}
  • Parameters:
  • filePath: string
  • Return Type: string
  • Calls:
  • filePath .split(/packages[\\/]+/) .slice(1) .join
  • relativePath .replace(/^[\\/]/, '') .replace(/(?:dist|lib|src)(\/|\\)/, '') .replace(/\.\w+$/, '') .replaceAll

fix(fixer: any): any

Code
fixer => fixer.replaceText(argument, `'${expected}'`)
  • Parameters:
  • fixer: any
  • Return Type: any
  • Calls:
  • fixer.replaceText

fix(fixer: any): any

Code
fixer => fixer.replaceText(argument, `'${expected}'`)
  • Parameters:
  • fixer: any
  • Return Type: any
  • Calls:
  • fixer.replaceText

fix(fixer: any): any

Code
fixer => fixer.replaceText(argument, `'${expected}'`)
  • Parameters:
  • fixer: any
  • Return Type: any
  • Calls:
  • fixer.replaceText

fix(fixer: any): any

Code
fixer => fixer.replaceText(argument, `'${expected}'`)
  • Parameters:
  • fixer: any
  • Return Type: any
  • Calls:
  • fixer.replaceText

fix(fixer: any): any

Code
fixer => fixer.replaceText(argument, `'${expected}'`)
  • Parameters:
  • fixer: any
  • Return Type: any
  • Calls:
  • fixer.replaceText

fix(fixer: any): any

Code
fixer => fixer.replaceText(argument, `'${expected}'`)
  • Parameters:
  • fixer: any
  • Return Type: any
  • Calls:
  • fixer.replaceText

fix(fixer: any): any

Code
fixer => fixer.replaceText(argument, `'${expected}'`)
  • Parameters:
  • fixer: any
  • Return Type: any
  • Calls:
  • fixer.replaceText

fix(fixer: any): any

Code
fixer => fixer.replaceText(argument, `'${expected}'`)
  • Parameters:
  • fixer: any
  • Return Type: any
  • Calls:
  • fixer.replaceText