import { ruleCreator } from "../_internal/rule-creator.js";
import { createReplacementRuleInfo, withDeprecatedRuleLifecycle, } from "../_internal/rule-deprecation.js";
const disallowedSelector = "Literal.source[value=/.(?:js|json|ts)$/u]";
/**
 * Disallow explicit `.js`, `.json`, and `.ts` source extensions in
 * imports/exports.
 */
const rule = ruleCreator({
    create: (context) => ({
        [disallowedSelector]: (node) => {
            context.report({
                messageId: "forbidden",
                node,
            });
        },
    }),
    defaultOptions: [],
    meta: {
        deprecated: true,
        docs: {
            deprecated: true,
            description: "require consistent import/export source paths without file extensions.",
            frozen: true,
            recommended: false,
            url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-source-extension",
        },
        hasSuggestions: false,
        messages: {
            forbidden: "Remove the source file extension from this import/export path.",
        },
        schema: [],
        type: "suggestion",
    },
    name: "consistent-source-extension",
});
/**
 * Wrapper rule with explicit lifecycle metadata and replacement mapping.
 */
const deprecatedRule = withDeprecatedRuleLifecycle(rule, {
    message: "Deprecated in favor of import/extensions.",
    replacedBy: [
        createReplacementRuleInfo({
            plugin: {
                name: "import",
                url: "https://github.com/import-js/eslint-plugin-import",
            },
            rule: {
                name: "extensions",
                url: "https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md",
            },
        }),
    ],
    ruleId: "consistent-source-extension",
});
export default deprecatedRule;
//# sourceMappingURL=consistent-source-extension.js.map