import { ruleCreator } from "../_internal/rule-creator.js";
const disallowedSelector = "LogicalExpression[operator='??'][left.type='ChainExpression']";
/**
 * Disallow mixing optional chaining expressions directly with nullish
 * coalescing.
 */
const rule = ruleCreator({
    create: (context) => ({
        [disallowedSelector]: (node) => {
            context.report({
                messageId: "forbidden",
                node,
            });
        },
    }),
    defaultOptions: [],
    meta: {
        deprecated: false,
        docs: {
            deprecated: false,
            description: "disallow mixing chain and coalescence operators in a single expression.",
            frozen: false,
            recommended: false,
            url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-chain-coalescence-mixture",
        },
        hasSuggestions: false,
        messages: {
            forbidden: "Do not mix optional chaining and nullish coalescing in the same expression.",
        },
        schema: [],
        type: "suggestion",
    },
    name: "no-chain-coalescence-mixture",
});
export default rule;
//# sourceMappingURL=no-chain-coalescence-mixture.js.map