How to use the @typescript-eslint/eslint-plugin/dist/util.getNameFromClassMember function in @typescript-eslint/eslint-plugin

To help you get started, we’ve selected a few @typescript-eslint/eslint-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / fluent-ui-react / packages / eslint-plugin / rules / no-visibility-modifiers / index.js View on Github external
function checkMethodAccessibilityModifier(methodDefinition) {
      let nodeType = 'method definition'

      if (['get', 'set'].includes(methodDefinition.kind)) {
        nodeType = `${methodDefinition.kind} property accessor`
      }

      if (isTypeScriptFile(context.getFilename())) {
        const methodName = util.getNameFromClassMember(methodDefinition, sourceCode)

        if (!!methodDefinition.accessibility) {
          reportIssue('presentModifier', nodeType, methodDefinition, methodName)
        }
      }
    }