{"version":3,"file":"index.cjs","names":[],"sources":["../../../rules/unified-latex-lint-no-def/index.ts"],"sourcesContent":["import { lintRule } from \"unified-lint-rule\";\nimport * as Ast from \"@unified-latex/unified-latex-types\";\nimport { match } from \"@unified-latex/unified-latex-util-match\";\nimport { visit } from \"@unified-latex/unified-latex-util-visit\";\n\nconst isDefMacro = match.createMacroMatcher([\"def\"]);\n\ntype PluginOptions = undefined;\n\nexport const DESCRIPTION = `## Lint Rule\n\nAvoid using \\`\\\\def\\\\macro{val}\\` to define a macro. Use \\`\\\\newcommand{\\\\macro}{val}\\` or\n\\`\\\\NewDocumentCommand{\\\\macro}{}{val}\\` from the \\`xparse\\` package.\n\n### See\n\nCTAN l2tabuen Section 1.7\n`;\n\nexport const unifiedLatexLintNoDef = lintRule<Ast.Root, PluginOptions>(\n    { origin: \"unified-latex-lint:no-def\" },\n    (tree, file) => {\n        visit(\n            tree,\n            (node) => {\n                file.message(\n                    `Do not use \\`\\\\def\\\\macro{val}\\` to define a macro. Use \\`\\\\newcommand{\\\\macro}{val}\\` or \\`\\\\NewDocumentCommand{\\\\macro}{}{val}\\` from the \\`xparse\\` package.`,\n                    node\n                );\n            },\n            { test: isDefMacro }\n        );\n    }\n);\n"],"mappings":";;;;;AAKA,IAAM,aAAa,wCAAA,MAAM,mBAAmB,CAAC,MAAM,CAAC;AAIpD,IAAa,cAAc;;;;;;;;;AAU3B,IAAa,wBAAwB,YAAA,SACjC,EAAE,QAAQ,6BAA6B,GACtC,MAAM,SAAS;AACZ,EAAA,GAAA,wCAAA,OACI,OACC,SAAS;AACN,OAAK,QACD,mKACA,KACH;IAEL,EAAE,MAAM,YAAY,CACvB;EAER"}