Skip to content

⬅️ Back to Table of Contents

πŸ“„ naming-convention-utils/shared

πŸ“Š 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

Parameters:

  • selectorType SelectorsString

Returns: string

Calls:

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

isMetaSelector(selector: IndividualAndMetaSelectorsString | Meta…): selector is MetaSelectorsString

Parameters:

  • selector IndividualAndMetaSelectorsString | MetaSelectors | Selectors

Returns: selector is MetaSelectorsString

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

isMethodOrPropertySelector(selector: IndividualAndMetaSelectorsString | Meta…): boolean

Parameters:

  • selector IndividualAndMetaSelectorsString | MetaSelectors | Selectors

Returns: boolean

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

Generated by Syntax Scribe