import { arrayJoin } from "ts-extras";
import { ruleCreator } from "../_internal/rule-creator.js";
// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- Keep String.raw to preserve backslashes required by selector regex parsing.
const languageMixPattern = String.raw `/\w[\d_]*[^\u0000-\u00ff]|[^\u0000-\u00ff][\d_]*\w/u`;
const disallowedSelector = arrayJoin([
    `Literal[value=${languageMixPattern}]`,
    `TemplateElement[value.raw=${languageMixPattern}]`,
], ", ");
/**
 * Disallow mixing latin and non-latin letters within the same token.
 */
const rule = ruleCreator({
    create: (context) => ({
        [disallowedSelector]: (node) => {
            context.report({
                messageId: "forbidden",
                node,
            });
        },
    }),
    defaultOptions: [],
    meta: {
        deprecated: false,
        docs: {
            deprecated: false,
            description: "disallow mixed-language tokens combining latin and non-latin letters.",
            frozen: false,
            recommended: false,
            url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-language-mixing",
        },
        hasSuggestions: false,
        messages: {
            forbidden: "Do not mix languages in a single token.",
        },
        schema: [],
        type: "suggestion",
    },
    name: "no-language-mixing",
});
export default rule;
//# sourceMappingURL=no-language-mixing.js.map