Skip to content

⬅️ Back to Table of Contents

📄 shared.ts

📊 Analysis Summary

Metric Count
🔧 Functions 3
📦 Imports 5

📚 Table of Contents

🛠️ File Location:

📂 packages/eslint-plugin/src/rules/naming-convention-utils/shared.ts

📦 Imports

Name Source
IndividualAndMetaSelectorsString ./enums
MetaSelectorsString ./enums
Selectors ./enums
SelectorsString ./enums
MetaSelectors ./enums

Functions

selectorTypeToMessageString(selectorType: SelectorsString): string

Code
export function selectorTypeToMessageString(
  selectorType: SelectorsString,
): string {
  const notCamelCase = selectorType.replaceAll(/([A-Z])/g, ' $1');
  return notCamelCase.charAt(0).toUpperCase() + notCamelCase.slice(1);
}
  • Parameters:
  • selectorType: SelectorsString
  • Return Type: string
  • Calls:
  • selectorType.replaceAll
  • notCamelCase.charAt(0).toUpperCase
  • notCamelCase.slice

isMetaSelector(selector: IndividualAndMetaSelectorsString | MetaSelectors | Selectors): selector is MetaSelectorsString

Code
export function isMetaSelector(
  selector: IndividualAndMetaSelectorsString | MetaSelectors | Selectors,
): selector is MetaSelectorsString {
  return selector in MetaSelectors;
}
  • Parameters:
  • selector: IndividualAndMetaSelectorsString | MetaSelectors | Selectors
  • Return Type: selector is MetaSelectorsString

isMethodOrPropertySelector(selector: IndividualAndMetaSelectorsString | MetaSelectors | Selectors): boolean

Code
export function isMethodOrPropertySelector(
  selector: IndividualAndMetaSelectorsString | MetaSelectors | Selectors,
): boolean {
  return (
    selector === MetaSelectors.method || selector === MetaSelectors.property
  );
}
  • Parameters:
  • selector: IndividualAndMetaSelectorsString | MetaSelectors | Selectors
  • Return Type: boolean