import { Context, __export, defaultOptions, plugin, schema } from "./chunk-IWHYDEIT.js"; // src/unused.ts var unused_exports = {}; __export(unused_exports, { RULE: () => RULE, clearCache: () => clearCache, rule: () => rule }); import { ESLintUtils } from "@typescript-eslint/utils"; var RULE = "unused"; var cache; var eslint = /* @__PURE__ */ new Set(); var clearCache = () => { cache = void 0; eslint.clear(); }; var rule = ESLintUtils.RuleCreator.withoutDocs({ meta: { messages: { [RULE]: "The following files are not used in the project:\n{{ files }}" }, schema, type: "problem" }, defaultOptions: [defaultOptions], create(context) { eslint.add(context.filename); const ctx = new Context(context, plugin, RULE, defaultOptions); if (!cache) { cache = ctx.filesWithContent(); } return { "Program:exit"(node) { if (cache?.paths.length === eslint?.size) { const unused = cache.unused().map((p) => p.filename); if (!unused.length) return; context.report({ node, messageId: RULE, data: { files: unused.join("\n") + "\n" } }); } } }; } }); export { RULE, clearCache, rule, unused_exports };