Skip to content

Does not suppprt markdown content @example #241

@JounQin

Description

@JounQin
import { RULE_DISABLED, RULE_NOT_CONFIGURED } from '../constants.js'

/**
 * Checks if a given Prettier rule value is valid and configured.
 *
 * This function determines whether the provided Prettier rule value is set and
 * valid. It considers values as non-existent if they are `RULE_NOT_CONFIGURED`,
 * `RULE_DISABLED`, or `undefined`.
 *
 * @example
 *   ```ts
 *   console.log(ruleValueExists('always')); // Output: true
 *   console.log(ruleValueExists(RULE_DISABLED)); // Output: false
 *   console.log(ruleValueExists(undefined)); // Output: false
 *   ```
 *
 * @param {unknown} prettierRuleValue - The value of the Prettier rule to check.
 * @returns {boolean} `true` if the rule value exists and is valid, otherwise
 *   `false`.
 */
export const ruleValueExists = (prettierRuleValue: unknown): boolean =>
  prettierRuleValue !== RULE_NOT_CONFIGURED &&
  prettierRuleValue !== RULE_DISABLED &&
  prettierRuleValue !== undefined
Image

After format:

Image

I removed the markdown code block as workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions