import { arrayJoin } from "ts-extras";
import { ruleCreator } from "../_internal/rule-creator.js";
const selector = arrayJoin([
    "TSPropertySignature[optional=true] > TSTypeAnnotation > TSLiteralType > Literal[value=true]",
    "TSPropertySignature[optional=true] > TSTypeAnnotation > TSLiteralType > Literal[value=false]",
], ", ");
/**
 * Disallow optional boolean literal property types.
 */
const rule = ruleCreator({
    create: (context) => ({
        [selector]: (node) => {
            if (node.type !== "Literal") {
                return;
            }
            context.report({
                fix: (fixer) => fixer.replaceText(node, "boolean"),
                messageId: "forbidden",
                node,
            });
        },
    }),
    defaultOptions: [],
    meta: {
        deprecated: false,
        docs: {
            deprecated: false,
            description: "disallow optional boolean literal types in property signatures.",
            frozen: false,
            recommended: false,
            url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-boolean-literal-type",
        },
        fixable: "code",
        hasSuggestions: false,
        messages: {
            forbidden: 'Use "boolean" type instead.',
        },
        schema: [],
        type: "suggestion",
    },
    name: "typescript/no-boolean-literal-type",
});
export default rule;
//# sourceMappingURL=typescript-no-boolean-literal-type.js.map