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 AST selector regex parsing.
const selector = String.raw `TSTypeAliasDeclaration > Identifier.id:matches([parent.typeAnnotation.type='TSArrayType'], [parent.typeAnnotation.type='TSTupleType']):not([name=/^(?:[A-Z][a-z\d]*)+(?:Array|s)$/u])`;
/**
 * Prefer reusable named aliases for array and tuple type aliases.
 */
const rule = ruleCreator({
    create: (context) => ({
        [selector]: (node) => {
            context.report({
                messageId: "forbidden",
                node,
            });
        },
    }),
    defaultOptions: [],
    meta: {
        deprecated: false,
        docs: {
            deprecated: false,
            description: "require reusable alias names for array and tuple type aliases.",
            frozen: false,
            recommended: false,
            url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-array-type-alias",
        },
        hasSuggestions: false,
        messages: {
            forbidden: 'Prefer a named alias ending in "Array" or "s" for array/tuple type aliases.',
        },
        schema: [],
        type: "suggestion",
    },
    name: "typescript/prefer-array-type-alias",
});
export default rule;
//# sourceMappingURL=typescript-prefer-array-type-alias.js.map