eslint-plugin-copilot 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5316 -0
- package/LICENSE +21 -0
- package/README.md +192 -0
- package/dist/_internal/copilot-config-references.d.ts +34 -0
- package/dist/_internal/copilot-config-references.d.ts.map +1 -0
- package/dist/_internal/copilot-config-references.js +55 -0
- package/dist/_internal/copilot-config-references.js.map +1 -0
- package/dist/_internal/copilot-customization-names.d.ts +21 -0
- package/dist/_internal/copilot-customization-names.d.ts.map +1 -0
- package/dist/_internal/copilot-customization-names.js +56 -0
- package/dist/_internal/copilot-customization-names.js.map +1 -0
- package/dist/_internal/copilot-file-kind.d.ts +19 -0
- package/dist/_internal/copilot-file-kind.d.ts.map +1 -0
- package/dist/_internal/copilot-file-kind.js +111 -0
- package/dist/_internal/copilot-file-kind.js.map +1 -0
- package/dist/_internal/create-copilot-rule.d.ts +39 -0
- package/dist/_internal/create-copilot-rule.d.ts.map +1 -0
- package/dist/_internal/create-copilot-rule.js +56 -0
- package/dist/_internal/create-copilot-rule.js.map +1 -0
- package/dist/_internal/customization-body.d.ts +6 -0
- package/dist/_internal/customization-body.d.ts.map +1 -0
- package/dist/_internal/customization-body.js +15 -0
- package/dist/_internal/customization-body.js.map +1 -0
- package/dist/_internal/duplicate-names.d.ts +12 -0
- package/dist/_internal/duplicate-names.d.ts.map +1 -0
- package/dist/_internal/duplicate-names.js +24 -0
- package/dist/_internal/duplicate-names.js.map +1 -0
- package/dist/_internal/file-system.d.ts +21 -0
- package/dist/_internal/file-system.d.ts.map +1 -0
- package/dist/_internal/file-system.js +86 -0
- package/dist/_internal/file-system.js.map +1 -0
- package/dist/_internal/frontmatter.d.ts +37 -0
- package/dist/_internal/frontmatter.d.ts.map +1 -0
- package/dist/_internal/frontmatter.js +398 -0
- package/dist/_internal/frontmatter.js.map +1 -0
- package/dist/_internal/markdown-links.d.ts +21 -0
- package/dist/_internal/markdown-links.d.ts.map +1 -0
- package/dist/_internal/markdown-links.js +81 -0
- package/dist/_internal/markdown-links.js.map +1 -0
- package/dist/_internal/markdown-rule.d.ts +13 -0
- package/dist/_internal/markdown-rule.d.ts.map +1 -0
- package/dist/_internal/markdown-rule.js +19 -0
- package/dist/_internal/markdown-rule.js.map +1 -0
- package/dist/_internal/repository-hooks-json.d.ts +55 -0
- package/dist/_internal/repository-hooks-json.d.ts.map +1 -0
- package/dist/_internal/repository-hooks-json.js +80 -0
- package/dist/_internal/repository-hooks-json.js.map +1 -0
- package/dist/_internal/rule-catalog.d.ts +20 -0
- package/dist/_internal/rule-catalog.d.ts.map +1 -0
- package/dist/_internal/rule-catalog.js +97 -0
- package/dist/_internal/rule-catalog.js.map +1 -0
- package/dist/_internal/rule-docs-url.d.ts +9 -0
- package/dist/_internal/rule-docs-url.d.ts.map +1 -0
- package/dist/_internal/rule-docs-url.js +9 -0
- package/dist/_internal/rule-docs-url.js.map +1 -0
- package/dist/_internal/rules-registry.d.ts +83 -0
- package/dist/_internal/rules-registry.d.ts.map +1 -0
- package/dist/_internal/rules-registry.js +145 -0
- package/dist/_internal/rules-registry.js.map +1 -0
- package/dist/_internal/skill-files.d.ts +8 -0
- package/dist/_internal/skill-files.d.ts.map +1 -0
- package/dist/_internal/skill-files.js +18 -0
- package/dist/_internal/skill-files.js.map +1 -0
- package/dist/plugin.cjs +5312 -0
- package/dist/plugin.cjs.map +7 -0
- package/dist/plugin.d.cts +34 -0
- package/dist/plugin.d.ts +34 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +142 -0
- package/dist/plugin.js.map +1 -0
- package/dist/rules/no-blank-customization-body.d.ts +4 -0
- package/dist/rules/no-blank-customization-body.d.ts.map +1 -0
- package/dist/rules/no-blank-customization-body.js +49 -0
- package/dist/rules/no-blank-customization-body.js.map +1 -0
- package/dist/rules/no-blank-repository-instructions.d.ts +4 -0
- package/dist/rules/no-blank-repository-instructions.d.ts.map +1 -0
- package/dist/rules/no-blank-repository-instructions.js +49 -0
- package/dist/rules/no-blank-repository-instructions.js.map +1 -0
- package/dist/rules/no-blank-skill-body.d.ts +4 -0
- package/dist/rules/no-blank-skill-body.d.ts.map +1 -0
- package/dist/rules/no-blank-skill-body.js +48 -0
- package/dist/rules/no-blank-skill-body.js.map +1 -0
- package/dist/rules/no-deprecated-agent-infer.d.ts +4 -0
- package/dist/rules/no-deprecated-agent-infer.d.ts.map +1 -0
- package/dist/rules/no-deprecated-agent-infer.js +48 -0
- package/dist/rules/no-deprecated-agent-infer.js.map +1 -0
- package/dist/rules/no-duplicate-agent-names.d.ts +4 -0
- package/dist/rules/no-duplicate-agent-names.d.ts.map +1 -0
- package/dist/rules/no-duplicate-agent-names.js +72 -0
- package/dist/rules/no-duplicate-agent-names.js.map +1 -0
- package/dist/rules/no-duplicate-prompt-names.d.ts +4 -0
- package/dist/rules/no-duplicate-prompt-names.d.ts.map +1 -0
- package/dist/rules/no-duplicate-prompt-names.js +72 -0
- package/dist/rules/no-duplicate-prompt-names.js.map +1 -0
- package/dist/rules/no-duplicate-skill-names.d.ts +4 -0
- package/dist/rules/no-duplicate-skill-names.d.ts.map +1 -0
- package/dist/rules/no-duplicate-skill-names.js +74 -0
- package/dist/rules/no-duplicate-skill-names.js.map +1 -0
- package/dist/rules/no-duplicate-slash-command-names.d.ts +4 -0
- package/dist/rules/no-duplicate-slash-command-names.d.ts.map +1 -0
- package/dist/rules/no-duplicate-slash-command-names.js +82 -0
- package/dist/rules/no-duplicate-slash-command-names.js.map +1 -0
- package/dist/rules/no-empty-repository-hook-arrays.d.ts +4 -0
- package/dist/rules/no-empty-repository-hook-arrays.d.ts.map +1 -0
- package/dist/rules/no-empty-repository-hook-arrays.js +49 -0
- package/dist/rules/no-empty-repository-hook-arrays.js.map +1 -0
- package/dist/rules/no-legacy-chatmode-files.d.ts +4 -0
- package/dist/rules/no-legacy-chatmode-files.d.ts.map +1 -0
- package/dist/rules/no-legacy-chatmode-files.js +42 -0
- package/dist/rules/no-legacy-chatmode-files.js.map +1 -0
- package/dist/rules/prefer-custom-instructions-under-code-review-limit.d.ts +4 -0
- package/dist/rules/prefer-custom-instructions-under-code-review-limit.d.ts.map +1 -0
- package/dist/rules/prefer-custom-instructions-under-code-review-limit.js +52 -0
- package/dist/rules/prefer-custom-instructions-under-code-review-limit.js.map +1 -0
- package/dist/rules/prefer-fast-repository-hooks.d.ts +4 -0
- package/dist/rules/prefer-fast-repository-hooks.d.ts.map +1 -0
- package/dist/rules/prefer-fast-repository-hooks.js +58 -0
- package/dist/rules/prefer-fast-repository-hooks.js.map +1 -0
- package/dist/rules/prefer-qualified-tools.d.ts +4 -0
- package/dist/rules/prefer-qualified-tools.d.ts.map +1 -0
- package/dist/rules/prefer-qualified-tools.js +56 -0
- package/dist/rules/prefer-qualified-tools.js.map +1 -0
- package/dist/rules/require-agent-tool-for-subagents.d.ts +4 -0
- package/dist/rules/require-agent-tool-for-subagents.d.ts.map +1 -0
- package/dist/rules/require-agent-tool-for-subagents.js +64 -0
- package/dist/rules/require-agent-tool-for-subagents.js.map +1 -0
- package/dist/rules/require-agents-md-for-cross-surface-agent-instructions.d.ts +4 -0
- package/dist/rules/require-agents-md-for-cross-surface-agent-instructions.d.ts.map +1 -0
- package/dist/rules/require-agents-md-for-cross-surface-agent-instructions.js +50 -0
- package/dist/rules/require-agents-md-for-cross-surface-agent-instructions.js.map +1 -0
- package/dist/rules/require-chatmode-file-metadata.d.ts +4 -0
- package/dist/rules/require-chatmode-file-metadata.d.ts.map +1 -0
- package/dist/rules/require-chatmode-file-metadata.js +59 -0
- package/dist/rules/require-chatmode-file-metadata.js.map +1 -0
- package/dist/rules/require-existing-agent-hook-cwd.d.ts +4 -0
- package/dist/rules/require-existing-agent-hook-cwd.d.ts.map +1 -0
- package/dist/rules/require-existing-agent-hook-cwd.js +64 -0
- package/dist/rules/require-existing-agent-hook-cwd.js.map +1 -0
- package/dist/rules/require-existing-agent-mcp-servers.d.ts +4 -0
- package/dist/rules/require-existing-agent-mcp-servers.d.ts.map +1 -0
- package/dist/rules/require-existing-agent-mcp-servers.js +58 -0
- package/dist/rules/require-existing-agent-mcp-servers.js.map +1 -0
- package/dist/rules/require-existing-relative-agent-links.d.ts +4 -0
- package/dist/rules/require-existing-relative-agent-links.d.ts.map +1 -0
- package/dist/rules/require-existing-relative-agent-links.js +61 -0
- package/dist/rules/require-existing-relative-agent-links.js.map +1 -0
- package/dist/rules/require-existing-relative-instructions-links.d.ts +4 -0
- package/dist/rules/require-existing-relative-instructions-links.d.ts.map +1 -0
- package/dist/rules/require-existing-relative-instructions-links.js +61 -0
- package/dist/rules/require-existing-relative-instructions-links.js.map +1 -0
- package/dist/rules/require-existing-relative-prompt-links.d.ts +4 -0
- package/dist/rules/require-existing-relative-prompt-links.d.ts.map +1 -0
- package/dist/rules/require-existing-relative-prompt-links.js +61 -0
- package/dist/rules/require-existing-relative-prompt-links.js.map +1 -0
- package/dist/rules/require-existing-relative-skill-links.d.ts +4 -0
- package/dist/rules/require-existing-relative-skill-links.d.ts.map +1 -0
- package/dist/rules/require-existing-relative-skill-links.js +61 -0
- package/dist/rules/require-existing-relative-skill-links.js.map +1 -0
- package/dist/rules/require-existing-repository-hook-cwd.d.ts +4 -0
- package/dist/rules/require-existing-repository-hook-cwd.d.ts.map +1 -0
- package/dist/rules/require-existing-repository-hook-cwd.js +65 -0
- package/dist/rules/require-existing-repository-hook-cwd.js.map +1 -0
- package/dist/rules/require-github-copilot-target-for-mcp-servers.d.ts +4 -0
- package/dist/rules/require-github-copilot-target-for-mcp-servers.d.ts.map +1 -0
- package/dist/rules/require-github-copilot-target-for-mcp-servers.js +63 -0
- package/dist/rules/require-github-copilot-target-for-mcp-servers.js.map +1 -0
- package/dist/rules/require-instructions-apply-to.d.ts +4 -0
- package/dist/rules/require-instructions-apply-to.d.ts.map +1 -0
- package/dist/rules/require-instructions-apply-to.js +60 -0
- package/dist/rules/require-instructions-apply-to.js.map +1 -0
- package/dist/rules/require-json-agent-mcp-servers.d.ts +4 -0
- package/dist/rules/require-json-agent-mcp-servers.d.ts.map +1 -0
- package/dist/rules/require-json-agent-mcp-servers.js +58 -0
- package/dist/rules/require-json-agent-mcp-servers.js.map +1 -0
- package/dist/rules/require-prompt-file-metadata.d.ts +4 -0
- package/dist/rules/require-prompt-file-metadata.d.ts.map +1 -0
- package/dist/rules/require-prompt-file-metadata.js +104 -0
- package/dist/rules/require-prompt-file-metadata.js.map +1 -0
- package/dist/rules/require-qualified-agent-handoff-models.d.ts +4 -0
- package/dist/rules/require-qualified-agent-handoff-models.d.ts.map +1 -0
- package/dist/rules/require-qualified-agent-handoff-models.js +78 -0
- package/dist/rules/require-qualified-agent-handoff-models.js.map +1 -0
- package/dist/rules/require-relative-agent-hook-cwd.d.ts +4 -0
- package/dist/rules/require-relative-agent-hook-cwd.d.ts.map +1 -0
- package/dist/rules/require-relative-agent-hook-cwd.js +70 -0
- package/dist/rules/require-relative-agent-hook-cwd.js.map +1 -0
- package/dist/rules/require-relative-agent-links.d.ts +4 -0
- package/dist/rules/require-relative-agent-links.d.ts.map +1 -0
- package/dist/rules/require-relative-agent-links.js +58 -0
- package/dist/rules/require-relative-agent-links.js.map +1 -0
- package/dist/rules/require-relative-instructions-links.d.ts +4 -0
- package/dist/rules/require-relative-instructions-links.d.ts.map +1 -0
- package/dist/rules/require-relative-instructions-links.js +58 -0
- package/dist/rules/require-relative-instructions-links.js.map +1 -0
- package/dist/rules/require-relative-prompt-links.d.ts +4 -0
- package/dist/rules/require-relative-prompt-links.d.ts.map +1 -0
- package/dist/rules/require-relative-prompt-links.js +82 -0
- package/dist/rules/require-relative-prompt-links.js.map +1 -0
- package/dist/rules/require-relative-repository-hook-cwd.d.ts +4 -0
- package/dist/rules/require-relative-repository-hook-cwd.d.ts.map +1 -0
- package/dist/rules/require-relative-repository-hook-cwd.js +63 -0
- package/dist/rules/require-relative-repository-hook-cwd.js.map +1 -0
- package/dist/rules/require-relative-skill-links.d.ts +4 -0
- package/dist/rules/require-relative-skill-links.d.ts.map +1 -0
- package/dist/rules/require-relative-skill-links.js +58 -0
- package/dist/rules/require-relative-skill-links.js.map +1 -0
- package/dist/rules/require-repository-hook-arrays.d.ts +4 -0
- package/dist/rules/require-repository-hook-arrays.d.ts.map +1 -0
- package/dist/rules/require-repository-hook-arrays.js +54 -0
- package/dist/rules/require-repository-hook-arrays.js.map +1 -0
- package/dist/rules/require-repository-hook-command-shell.d.ts +4 -0
- package/dist/rules/require-repository-hook-command-shell.d.ts.map +1 -0
- package/dist/rules/require-repository-hook-command-shell.js +57 -0
- package/dist/rules/require-repository-hook-command-shell.js.map +1 -0
- package/dist/rules/require-repository-hooks-object.d.ts +4 -0
- package/dist/rules/require-repository-hooks-object.d.ts.map +1 -0
- package/dist/rules/require-repository-hooks-object.js +50 -0
- package/dist/rules/require-repository-hooks-object.js.map +1 -0
- package/dist/rules/require-repository-instructions-file.d.ts +4 -0
- package/dist/rules/require-repository-instructions-file.d.ts.map +1 -0
- package/dist/rules/require-repository-instructions-file.js +50 -0
- package/dist/rules/require-repository-instructions-file.js.map +1 -0
- package/dist/rules/require-skill-file-location.d.ts +4 -0
- package/dist/rules/require-skill-file-location.d.ts.map +1 -0
- package/dist/rules/require-skill-file-location.js +46 -0
- package/dist/rules/require-skill-file-location.js.map +1 -0
- package/dist/rules/require-skill-file-metadata.d.ts +4 -0
- package/dist/rules/require-skill-file-metadata.d.ts.map +1 -0
- package/dist/rules/require-skill-file-metadata.js +60 -0
- package/dist/rules/require-skill-file-metadata.js.map +1 -0
- package/dist/rules/require-skill-md-filename.d.ts +4 -0
- package/dist/rules/require-skill-md-filename.d.ts.map +1 -0
- package/dist/rules/require-skill-md-filename.js +55 -0
- package/dist/rules/require-skill-md-filename.js.map +1 -0
- package/dist/rules/require-skill-name-match-directory.d.ts +4 -0
- package/dist/rules/require-skill-name-match-directory.d.ts.map +1 -0
- package/dist/rules/require-skill-name-match-directory.js +59 -0
- package/dist/rules/require-skill-name-match-directory.js.map +1 -0
- package/dist/rules/require-string-repository-hook-env-values.d.ts +4 -0
- package/dist/rules/require-string-repository-hook-env-values.d.ts.map +1 -0
- package/dist/rules/require-string-repository-hook-env-values.js +59 -0
- package/dist/rules/require-string-repository-hook-env-values.js.map +1 -0
- package/dist/rules/require-valid-agent-argument-hint.d.ts +4 -0
- package/dist/rules/require-valid-agent-argument-hint.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-argument-hint.js +51 -0
- package/dist/rules/require-valid-agent-argument-hint.js.map +1 -0
- package/dist/rules/require-valid-agent-handoff-send.d.ts +4 -0
- package/dist/rules/require-valid-agent-handoff-send.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-handoff-send.js +67 -0
- package/dist/rules/require-valid-agent-handoff-send.js.map +1 -0
- package/dist/rules/require-valid-agent-handoffs.d.ts +4 -0
- package/dist/rules/require-valid-agent-handoffs.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-handoffs.js +78 -0
- package/dist/rules/require-valid-agent-handoffs.js.map +1 -0
- package/dist/rules/require-valid-agent-hook-events.d.ts +4 -0
- package/dist/rules/require-valid-agent-hook-events.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-hook-events.js +68 -0
- package/dist/rules/require-valid-agent-hook-events.js.map +1 -0
- package/dist/rules/require-valid-agent-hook-timeouts.d.ts +4 -0
- package/dist/rules/require-valid-agent-hook-timeouts.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-hook-timeouts.js +83 -0
- package/dist/rules/require-valid-agent-hook-timeouts.js.map +1 -0
- package/dist/rules/require-valid-agent-hooks.d.ts +4 -0
- package/dist/rules/require-valid-agent-hooks.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-hooks.js +86 -0
- package/dist/rules/require-valid-agent-hooks.js.map +1 -0
- package/dist/rules/require-valid-agent-invocation-controls.d.ts +4 -0
- package/dist/rules/require-valid-agent-invocation-controls.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-invocation-controls.js +71 -0
- package/dist/rules/require-valid-agent-invocation-controls.js.map +1 -0
- package/dist/rules/require-valid-agent-mcp-servers.d.ts +4 -0
- package/dist/rules/require-valid-agent-mcp-servers.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-mcp-servers.js +64 -0
- package/dist/rules/require-valid-agent-mcp-servers.js.map +1 -0
- package/dist/rules/require-valid-agent-model.d.ts +4 -0
- package/dist/rules/require-valid-agent-model.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-model.js +64 -0
- package/dist/rules/require-valid-agent-model.js.map +1 -0
- package/dist/rules/require-valid-agent-name.d.ts +4 -0
- package/dist/rules/require-valid-agent-name.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-name.js +51 -0
- package/dist/rules/require-valid-agent-name.js.map +1 -0
- package/dist/rules/require-valid-agent-subagents.d.ts +4 -0
- package/dist/rules/require-valid-agent-subagents.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-subagents.js +79 -0
- package/dist/rules/require-valid-agent-subagents.js.map +1 -0
- package/dist/rules/require-valid-agent-target.d.ts +4 -0
- package/dist/rules/require-valid-agent-target.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-target.js +62 -0
- package/dist/rules/require-valid-agent-target.js.map +1 -0
- package/dist/rules/require-valid-agent-tools.d.ts +4 -0
- package/dist/rules/require-valid-agent-tools.d.ts.map +1 -0
- package/dist/rules/require-valid-agent-tools.js +64 -0
- package/dist/rules/require-valid-agent-tools.js.map +1 -0
- package/dist/rules/require-valid-instructions-apply-to-globs.d.ts +4 -0
- package/dist/rules/require-valid-instructions-apply-to-globs.d.ts.map +1 -0
- package/dist/rules/require-valid-instructions-apply-to-globs.js +79 -0
- package/dist/rules/require-valid-instructions-apply-to-globs.js.map +1 -0
- package/dist/rules/require-valid-prompt-argument-hint.d.ts +4 -0
- package/dist/rules/require-valid-prompt-argument-hint.d.ts.map +1 -0
- package/dist/rules/require-valid-prompt-argument-hint.js +52 -0
- package/dist/rules/require-valid-prompt-argument-hint.js.map +1 -0
- package/dist/rules/require-valid-prompt-model.d.ts +4 -0
- package/dist/rules/require-valid-prompt-model.d.ts.map +1 -0
- package/dist/rules/require-valid-prompt-model.js +77 -0
- package/dist/rules/require-valid-prompt-model.js.map +1 -0
- package/dist/rules/require-valid-prompt-name.d.ts +4 -0
- package/dist/rules/require-valid-prompt-name.d.ts.map +1 -0
- package/dist/rules/require-valid-prompt-name.js +51 -0
- package/dist/rules/require-valid-prompt-name.js.map +1 -0
- package/dist/rules/require-valid-prompt-tools.d.ts +4 -0
- package/dist/rules/require-valid-prompt-tools.d.ts.map +1 -0
- package/dist/rules/require-valid-prompt-tools.js +64 -0
- package/dist/rules/require-valid-prompt-tools.js.map +1 -0
- package/dist/rules/require-valid-repository-hook-command-type.d.ts +4 -0
- package/dist/rules/require-valid-repository-hook-command-type.d.ts.map +1 -0
- package/dist/rules/require-valid-repository-hook-command-type.js +58 -0
- package/dist/rules/require-valid-repository-hook-command-type.js.map +1 -0
- package/dist/rules/require-valid-repository-hook-env.d.ts +4 -0
- package/dist/rules/require-valid-repository-hook-env.d.ts.map +1 -0
- package/dist/rules/require-valid-repository-hook-env.js +57 -0
- package/dist/rules/require-valid-repository-hook-env.js.map +1 -0
- package/dist/rules/require-valid-repository-hook-events.d.ts +4 -0
- package/dist/rules/require-valid-repository-hook-events.d.ts.map +1 -0
- package/dist/rules/require-valid-repository-hook-events.js +55 -0
- package/dist/rules/require-valid-repository-hook-events.js.map +1 -0
- package/dist/rules/require-valid-repository-hook-timeouts.d.ts +4 -0
- package/dist/rules/require-valid-repository-hook-timeouts.d.ts.map +1 -0
- package/dist/rules/require-valid-repository-hook-timeouts.js +59 -0
- package/dist/rules/require-valid-repository-hook-timeouts.js.map +1 -0
- package/dist/rules/require-valid-repository-hook-version.d.ts +4 -0
- package/dist/rules/require-valid-repository-hook-version.d.ts.map +1 -0
- package/dist/rules/require-valid-repository-hook-version.js +53 -0
- package/dist/rules/require-valid-repository-hook-version.js.map +1 -0
- package/dist/rules/require-valid-skill-directory-name.d.ts +4 -0
- package/dist/rules/require-valid-skill-directory-name.d.ts.map +1 -0
- package/dist/rules/require-valid-skill-directory-name.js +50 -0
- package/dist/rules/require-valid-skill-directory-name.js.map +1 -0
- package/dist/rules/require-valid-skill-license.d.ts +4 -0
- package/dist/rules/require-valid-skill-license.d.ts.map +1 -0
- package/dist/rules/require-valid-skill-license.js +47 -0
- package/dist/rules/require-valid-skill-license.js.map +1 -0
- package/dist/rules/require-valid-skill-name.d.ts +4 -0
- package/dist/rules/require-valid-skill-name.d.ts.map +1 -0
- package/dist/rules/require-valid-skill-name.js +57 -0
- package/dist/rules/require-valid-skill-name.js.map +1 -0
- package/docs/rules/getting-started.md +24 -0
- package/docs/rules/guides/copilot-customization-files.md +17 -0
- package/docs/rules/no-blank-customization-body.md +52 -0
- package/docs/rules/no-blank-repository-instructions.md +37 -0
- package/docs/rules/no-blank-skill-body.md +41 -0
- package/docs/rules/no-deprecated-agent-infer.md +42 -0
- package/docs/rules/no-duplicate-agent-names.md +36 -0
- package/docs/rules/no-duplicate-prompt-names.md +36 -0
- package/docs/rules/no-duplicate-skill-names.md +37 -0
- package/docs/rules/no-duplicate-slash-command-names.md +40 -0
- package/docs/rules/no-empty-repository-hook-arrays.md +44 -0
- package/docs/rules/no-legacy-chatmode-files.md +53 -0
- package/docs/rules/overview.md +27 -0
- package/docs/rules/prefer-custom-instructions-under-code-review-limit.md +39 -0
- package/docs/rules/prefer-fast-repository-hooks.md +43 -0
- package/docs/rules/prefer-qualified-tools.md +49 -0
- package/docs/rules/presets/all.md +82 -0
- package/docs/rules/presets/index.md +78 -0
- package/docs/rules/presets/minimal.md +16 -0
- package/docs/rules/presets/recommended.md +67 -0
- package/docs/rules/presets/strict.md +81 -0
- package/docs/rules/require-agent-tool-for-subagents.md +44 -0
- package/docs/rules/require-agents-md-for-cross-surface-agent-instructions.md +39 -0
- package/docs/rules/require-chatmode-file-metadata.md +41 -0
- package/docs/rules/require-existing-agent-hook-cwd.md +51 -0
- package/docs/rules/require-existing-agent-mcp-servers.md +43 -0
- package/docs/rules/require-existing-relative-agent-links.md +41 -0
- package/docs/rules/require-existing-relative-instructions-links.md +43 -0
- package/docs/rules/require-existing-relative-prompt-links.md +41 -0
- package/docs/rules/require-existing-relative-skill-links.md +44 -0
- package/docs/rules/require-existing-repository-hook-cwd.md +45 -0
- package/docs/rules/require-github-copilot-target-for-mcp-servers.md +46 -0
- package/docs/rules/require-instructions-apply-to.md +40 -0
- package/docs/rules/require-json-agent-mcp-servers.md +41 -0
- package/docs/rules/require-prompt-file-metadata.md +45 -0
- package/docs/rules/require-qualified-agent-handoff-models.md +47 -0
- package/docs/rules/require-relative-agent-hook-cwd.md +50 -0
- package/docs/rules/require-relative-agent-links.md +40 -0
- package/docs/rules/require-relative-instructions-links.md +42 -0
- package/docs/rules/require-relative-prompt-links.md +43 -0
- package/docs/rules/require-relative-repository-hook-cwd.md +43 -0
- package/docs/rules/require-relative-skill-links.md +42 -0
- package/docs/rules/require-repository-hook-arrays.md +33 -0
- package/docs/rules/require-repository-hook-command-shell.md +44 -0
- package/docs/rules/require-repository-hooks-object.md +34 -0
- package/docs/rules/require-repository-instructions-file.md +42 -0
- package/docs/rules/require-skill-file-location.md +33 -0
- package/docs/rules/require-skill-file-metadata.md +40 -0
- package/docs/rules/require-skill-md-filename.md +43 -0
- package/docs/rules/require-skill-name-match-directory.md +46 -0
- package/docs/rules/require-string-repository-hook-env-values.md +43 -0
- package/docs/rules/require-valid-agent-argument-hint.md +42 -0
- package/docs/rules/require-valid-agent-handoff-send.md +49 -0
- package/docs/rules/require-valid-agent-handoffs.md +51 -0
- package/docs/rules/require-valid-agent-hook-events.md +47 -0
- package/docs/rules/require-valid-agent-hook-timeouts.md +49 -0
- package/docs/rules/require-valid-agent-hooks.md +49 -0
- package/docs/rules/require-valid-agent-invocation-controls.md +45 -0
- package/docs/rules/require-valid-agent-mcp-servers.md +45 -0
- package/docs/rules/require-valid-agent-model.md +43 -0
- package/docs/rules/require-valid-agent-name.md +42 -0
- package/docs/rules/require-valid-agent-subagents.md +52 -0
- package/docs/rules/require-valid-agent-target.md +44 -0
- package/docs/rules/require-valid-agent-tools.md +43 -0
- package/docs/rules/require-valid-instructions-apply-to-globs.md +45 -0
- package/docs/rules/require-valid-prompt-argument-hint.md +42 -0
- package/docs/rules/require-valid-prompt-model.md +45 -0
- package/docs/rules/require-valid-prompt-name.md +42 -0
- package/docs/rules/require-valid-prompt-tools.md +43 -0
- package/docs/rules/require-valid-repository-hook-command-type.md +45 -0
- package/docs/rules/require-valid-repository-hook-env.md +43 -0
- package/docs/rules/require-valid-repository-hook-events.md +34 -0
- package/docs/rules/require-valid-repository-hook-timeouts.md +43 -0
- package/docs/rules/require-valid-repository-hook-version.md +34 -0
- package/docs/rules/require-valid-skill-directory-name.md +34 -0
- package/docs/rules/require-valid-skill-license.md +45 -0
- package/docs/rules/require-valid-skill-name.md +43 -0
- package/package.json +562 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Public plugin entrypoint for eslint-plugin-copilot.
|
|
4
|
+
*/
|
|
5
|
+
import type { ESLint, Linter } from "eslint";
|
|
6
|
+
import { type CopilotConfigName } from "./_internal/copilot-config-references.js";
|
|
7
|
+
import { copilotRules } from "./_internal/rules-registry.js";
|
|
8
|
+
/** Flat-config preset layers produced by this plugin. */
|
|
9
|
+
export type CopilotPresetConfig = CopilotPresetLayer[];
|
|
10
|
+
/** Flat-config preset shape produced by this plugin. */
|
|
11
|
+
export type CopilotPresetLayer = Linter.Config & {
|
|
12
|
+
rules: NonNullable<Linter.Config["rules"]>;
|
|
13
|
+
};
|
|
14
|
+
/** Fully qualified Copilot rule ids. */
|
|
15
|
+
export type CopilotRuleId = `copilot/${CopilotRuleName}`;
|
|
16
|
+
/** Unqualified rule names supported by eslint-plugin-copilot. */
|
|
17
|
+
export type CopilotRuleName = keyof typeof copilotRules;
|
|
18
|
+
/** Contract for the exported preset map. */
|
|
19
|
+
type CopilotConfigsContract = Record<CopilotConfigName, CopilotPresetConfig>;
|
|
20
|
+
/** Fully assembled plugin contract used by the runtime default export. */
|
|
21
|
+
type CopilotPluginContract = Omit<ESLint.Plugin, "configs" | "rules"> & {
|
|
22
|
+
configs: CopilotConfigsContract;
|
|
23
|
+
meta: {
|
|
24
|
+
name: string;
|
|
25
|
+
namespace: string;
|
|
26
|
+
version: string;
|
|
27
|
+
};
|
|
28
|
+
processors: NonNullable<ESLint.Plugin["processors"]>;
|
|
29
|
+
rules: NonNullable<ESLint.Plugin["rules"]>;
|
|
30
|
+
};
|
|
31
|
+
/** Public ESLint plugin entrypoint, including runtime presets and rule metadata. */
|
|
32
|
+
declare const plugin: CopilotPluginContract;
|
|
33
|
+
export default plugin;
|
|
34
|
+
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Public plugin entrypoint for eslint-plugin-copilot.
|
|
4
|
+
*/
|
|
5
|
+
import type { ESLint, Linter } from "eslint";
|
|
6
|
+
import { type CopilotConfigName } from "./_internal/copilot-config-references.js";
|
|
7
|
+
import { copilotRules } from "./_internal/rules-registry.js";
|
|
8
|
+
/** Flat-config preset layers produced by this plugin. */
|
|
9
|
+
export type CopilotPresetConfig = CopilotPresetLayer[];
|
|
10
|
+
/** Flat-config preset shape produced by this plugin. */
|
|
11
|
+
export type CopilotPresetLayer = Linter.Config & {
|
|
12
|
+
rules: NonNullable<Linter.Config["rules"]>;
|
|
13
|
+
};
|
|
14
|
+
/** Fully qualified Copilot rule ids. */
|
|
15
|
+
export type CopilotRuleId = `copilot/${CopilotRuleName}`;
|
|
16
|
+
/** Unqualified rule names supported by eslint-plugin-copilot. */
|
|
17
|
+
export type CopilotRuleName = keyof typeof copilotRules;
|
|
18
|
+
/** Contract for the exported preset map. */
|
|
19
|
+
type CopilotConfigsContract = Record<CopilotConfigName, CopilotPresetConfig>;
|
|
20
|
+
/** Fully assembled plugin contract used by the runtime default export. */
|
|
21
|
+
type CopilotPluginContract = Omit<ESLint.Plugin, "configs" | "rules"> & {
|
|
22
|
+
configs: CopilotConfigsContract;
|
|
23
|
+
meta: {
|
|
24
|
+
name: string;
|
|
25
|
+
namespace: string;
|
|
26
|
+
version: string;
|
|
27
|
+
};
|
|
28
|
+
processors: NonNullable<ESLint.Plugin["processors"]>;
|
|
29
|
+
rules: NonNullable<ESLint.Plugin["rules"]>;
|
|
30
|
+
};
|
|
31
|
+
/** Public ESLint plugin entrypoint, including runtime presets and rule metadata. */
|
|
32
|
+
declare const plugin: CopilotPluginContract;
|
|
33
|
+
export default plugin;
|
|
34
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQ7C,OAAO,EAEH,KAAK,iBAAiB,EACzB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAwC7D,yDAAyD;AACzD,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,EAAE,CAAC;AAEvD,wDAAwD;AACxD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,GAAG;IAC7C,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;CAC9C,CAAC;AAEF,wCAAwC;AACxC,MAAM,MAAM,aAAa,GAAG,WAAW,eAAe,EAAE,CAAC;AAEzD,iEAAiE;AACjE,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC;AAExD,4CAA4C;AAC5C,KAAK,sBAAsB,GAAG,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;AAE7E,0EAA0E;AAC1E,KAAK,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,GAAG;IACpE,OAAO,EAAE,sBAAsB,CAAC;IAChC,IAAI,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IACrD,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;CAC9C,CAAC;AAqIF,oFAAoF;AACpF,QAAA,MAAM,MAAM,EAAE,qBASb,CAAC;AASF,eAAe,MAAM,CAAC"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import json from "@eslint/json";
|
|
2
|
+
import markdown from "@eslint/markdown";
|
|
3
|
+
import packageJson from "../package.json" with { type: "json" };
|
|
4
|
+
import { copilotConfigMetadataByName, } from "./_internal/copilot-config-references.js";
|
|
5
|
+
import { copilotRules } from "./_internal/rules-registry.js";
|
|
6
|
+
/** ESLint severity used by generated preset rule maps. */
|
|
7
|
+
const ERROR_SEVERITY = "error";
|
|
8
|
+
/** Markdown files linted by the shipped Copilot presets. */
|
|
9
|
+
const COPILOT_MARKDOWN_FILES = [
|
|
10
|
+
".github/copilot-instructions.md",
|
|
11
|
+
".github/instructions/**/*.instructions.md",
|
|
12
|
+
".github/prompts/**/*.prompt.md",
|
|
13
|
+
".github/agents/**/*.agent.md",
|
|
14
|
+
".github/chatmodes/**/*.chatmode.md",
|
|
15
|
+
".github/skills/**/*.md",
|
|
16
|
+
".claude/skills/**/*.md",
|
|
17
|
+
"**/SKILL.md",
|
|
18
|
+
"**/AGENTS.md",
|
|
19
|
+
"**/CLAUDE.md",
|
|
20
|
+
"**/GEMINI.md",
|
|
21
|
+
];
|
|
22
|
+
/** Repository hook JSON files linted by the shipped Copilot presets. */
|
|
23
|
+
const COPILOT_JSON_FILES = [".github/hooks/**/*.json"];
|
|
24
|
+
/** Hook JSON rules that should only be enabled in the JSON preset layer. */
|
|
25
|
+
const REPOSITORY_HOOK_JSON_RULE_NAMES = new Set([
|
|
26
|
+
"no-empty-repository-hook-arrays",
|
|
27
|
+
"prefer-fast-repository-hooks",
|
|
28
|
+
"require-existing-repository-hook-cwd",
|
|
29
|
+
"require-relative-repository-hook-cwd",
|
|
30
|
+
"require-repository-hook-arrays",
|
|
31
|
+
"require-repository-hook-command-shell",
|
|
32
|
+
"require-repository-hooks-object",
|
|
33
|
+
"require-string-repository-hook-env-values",
|
|
34
|
+
"require-valid-repository-hook-command-type",
|
|
35
|
+
"require-valid-repository-hook-env",
|
|
36
|
+
"require-valid-repository-hook-events",
|
|
37
|
+
"require-valid-repository-hook-timeouts",
|
|
38
|
+
"require-valid-repository-hook-version",
|
|
39
|
+
]);
|
|
40
|
+
/** Resolve the package version from package.json data. */
|
|
41
|
+
const getPackageVersion = (pkg) => {
|
|
42
|
+
if (typeof pkg !== "object" || pkg === null) {
|
|
43
|
+
return "0.0.0";
|
|
44
|
+
}
|
|
45
|
+
const version = Reflect.get(pkg, "version");
|
|
46
|
+
return typeof version === "string" ? version : "0.0.0";
|
|
47
|
+
};
|
|
48
|
+
/** Strongly typed ESLint rule map view of the runtime registry. */
|
|
49
|
+
const eslintRules = copilotRules;
|
|
50
|
+
const markdownPlugin = markdown;
|
|
51
|
+
const jsonPlugin = json;
|
|
52
|
+
/** Stable ordered entries used to derive preset membership. */
|
|
53
|
+
const copilotRuleEntries = Object.entries(copilotRules).toSorted(([left], [right]) => left.localeCompare(right));
|
|
54
|
+
/** Create an empty mutable preset-rule bucket map. */
|
|
55
|
+
const createEmptyPresetRuleMap = () => ({
|
|
56
|
+
all: [],
|
|
57
|
+
minimal: [],
|
|
58
|
+
recommended: [],
|
|
59
|
+
strict: [],
|
|
60
|
+
});
|
|
61
|
+
/** Remove duplicates while preserving first-seen ordering. */
|
|
62
|
+
const dedupeRuleNames = (ruleNames) => [...new Set(ruleNames)];
|
|
63
|
+
/** Derive preset membership directly from static rule docs metadata. */
|
|
64
|
+
const derivePresetRuleNamesByConfig = () => {
|
|
65
|
+
const presetRuleMap = createEmptyPresetRuleMap();
|
|
66
|
+
for (const [ruleName, ruleModule] of copilotRuleEntries) {
|
|
67
|
+
const docs = ruleModule.meta.docs;
|
|
68
|
+
const configNames = docs.copilotConfigNames;
|
|
69
|
+
for (const configName of configNames) {
|
|
70
|
+
presetRuleMap[configName].push(ruleName);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
all: dedupeRuleNames(presetRuleMap.all),
|
|
75
|
+
minimal: dedupeRuleNames(presetRuleMap.minimal),
|
|
76
|
+
recommended: dedupeRuleNames(presetRuleMap.recommended),
|
|
77
|
+
strict: dedupeRuleNames(presetRuleMap.strict),
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
/** Build a flat-config rules map that enables the provided rules at error. */
|
|
81
|
+
const errorRulesFor = (ruleNames) => {
|
|
82
|
+
const rules = {};
|
|
83
|
+
for (const ruleName of ruleNames) {
|
|
84
|
+
rules[`copilot/${ruleName}`] = ERROR_SEVERITY;
|
|
85
|
+
}
|
|
86
|
+
return rules;
|
|
87
|
+
};
|
|
88
|
+
const presetRuleNamesByConfig = derivePresetRuleNamesByConfig();
|
|
89
|
+
/** Split preset rule names into markdown-backed and JSON-backed layers. */
|
|
90
|
+
const partitionRuleNamesByPresetLayer = (ruleNames) => ({
|
|
91
|
+
jsonRuleNames: ruleNames.filter((ruleName) => REPOSITORY_HOOK_JSON_RULE_NAMES.has(ruleName)),
|
|
92
|
+
markdownRuleNames: ruleNames.filter((ruleName) => !REPOSITORY_HOOK_JSON_RULE_NAMES.has(ruleName)),
|
|
93
|
+
});
|
|
94
|
+
/** Build one public preset config as layered flat-config entries. */
|
|
95
|
+
const createPresetConfig = (configName, plugin) => {
|
|
96
|
+
const presetName = copilotConfigMetadataByName[configName].presetName;
|
|
97
|
+
const { jsonRuleNames, markdownRuleNames } = partitionRuleNamesByPresetLayer(presetRuleNamesByConfig[configName]);
|
|
98
|
+
const configLayers = [
|
|
99
|
+
{
|
|
100
|
+
files: [...COPILOT_MARKDOWN_FILES],
|
|
101
|
+
language: "markdown/gfm",
|
|
102
|
+
name: `${presetName}:markdown`,
|
|
103
|
+
plugins: {
|
|
104
|
+
copilot: plugin,
|
|
105
|
+
markdown: markdownPlugin,
|
|
106
|
+
},
|
|
107
|
+
rules: errorRulesFor(markdownRuleNames),
|
|
108
|
+
},
|
|
109
|
+
];
|
|
110
|
+
if (jsonRuleNames.length > 0) {
|
|
111
|
+
configLayers.push({
|
|
112
|
+
files: [...COPILOT_JSON_FILES],
|
|
113
|
+
language: "json/json",
|
|
114
|
+
name: `${presetName}:json`,
|
|
115
|
+
plugins: {
|
|
116
|
+
copilot: plugin,
|
|
117
|
+
json: jsonPlugin,
|
|
118
|
+
},
|
|
119
|
+
rules: errorRulesFor(jsonRuleNames),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return configLayers;
|
|
123
|
+
};
|
|
124
|
+
/** Public ESLint plugin entrypoint, including runtime presets and rule metadata. */
|
|
125
|
+
const plugin = {
|
|
126
|
+
configs: {},
|
|
127
|
+
meta: {
|
|
128
|
+
name: "eslint-plugin-copilot",
|
|
129
|
+
namespace: "copilot",
|
|
130
|
+
version: getPackageVersion(packageJson),
|
|
131
|
+
},
|
|
132
|
+
processors: {},
|
|
133
|
+
rules: eslintRules,
|
|
134
|
+
};
|
|
135
|
+
plugin.configs = {
|
|
136
|
+
all: createPresetConfig("all", plugin),
|
|
137
|
+
minimal: createPresetConfig("minimal", plugin),
|
|
138
|
+
recommended: createPresetConfig("recommended", plugin),
|
|
139
|
+
strict: createPresetConfig("strict", plugin),
|
|
140
|
+
};
|
|
141
|
+
export default plugin;
|
|
142
|
+
//# sourceMappingURL=plugin.js.map
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AC9B,OAAO,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,QAAQ,EAAE,cAAc;aAC3B;YACD,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC;SAC1C;KACJ,CAAC;IAEF,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,YAAY,CAAC,IAAI,CAAC;YACd,KAAK,EAAE,CAAC,GAAG,kBAAkB,CAAC;YAC9B,QAAQ,EAAE,WAAW;YACrB,IAAI,EAAE,GAAG,UAAU,OAAO;YAC1B,OAAO,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,IAAI,EAAE,UAAU;aACnB;YACD,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC;SACtC,CAAC,CAAC;IACP,CAAC;IAED,OAAO,YAAY,CAAC;AACxB,CAAC,CAAC;AAEF,oFAAoF;AACpF,MAAM,MAAM,GAA0B;IAClC,OAAO,EAAE,EAA4B;IACrC,IAAI,EAAE;QACF,IAAI,EAAE,uBAAuB;QAC7B,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,iBAAiB,CAAC,WAAW,CAAC;KAC1C;IACD,UAAU,EAAE,EAAE;IACd,KAAK,EAAE,WAAW;CACrB,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG;IACb,GAAG,EAAE,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC;IACtC,OAAO,EAAE,kBAAkB,CAAC,SAAS,EAAE,MAAM,CAAC;IAC9C,WAAW,EAAE,kBAAkB,CAAC,aAAa,EAAE,MAAM,CAAC;IACtD,MAAM,EAAE,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC/C,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-blank-customization-body.d.ts","sourceRoot":"","sources":["../../src/rules/no-blank-customization-body.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAiB7E,QAAA,MAAM,4BAA4B,EAAE,iBA4ClC,CAAC;AAEH,eAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* ESLint rule implementation for `no-blank-customization-body`.
|
|
4
|
+
*/
|
|
5
|
+
import { getCopilotFileKind } from "../_internal/copilot-file-kind.js";
|
|
6
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
7
|
+
import { extractFrontmatter, getMeaningfulMarkdownBody, } from "../_internal/frontmatter.js";
|
|
8
|
+
import { createMarkdownDocumentListener, reportAtDocumentStart, } from "../_internal/markdown-rule.js";
|
|
9
|
+
const noBlankCustomizationBodyRule = createCopilotRule({
|
|
10
|
+
create(context) {
|
|
11
|
+
return createMarkdownDocumentListener(() => {
|
|
12
|
+
const fileKind = getCopilotFileKind(context.filename);
|
|
13
|
+
if (fileKind === null || fileKind === "repository-instructions") {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
17
|
+
const bodyText = frontmatter?.body ?? context.sourceCode.text;
|
|
18
|
+
if (getMeaningfulMarkdownBody(bodyText).length > 0) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
reportAtDocumentStart(context, {
|
|
22
|
+
messageId: "blankBody",
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
defaultOptions: [],
|
|
27
|
+
meta: {
|
|
28
|
+
deprecated: false,
|
|
29
|
+
docs: {
|
|
30
|
+
copilotConfigs: [
|
|
31
|
+
"copilot.configs.recommended",
|
|
32
|
+
"copilot.configs.strict",
|
|
33
|
+
"copilot.configs.all",
|
|
34
|
+
],
|
|
35
|
+
description: "disallow blank bodies in Copilot customization files other than repository-wide instructions.",
|
|
36
|
+
frozen: false,
|
|
37
|
+
recommended: true,
|
|
38
|
+
requiresTypeChecking: false,
|
|
39
|
+
},
|
|
40
|
+
messages: {
|
|
41
|
+
blankBody: "Copilot customization files should include meaningful Markdown instructions in the document body, not only frontmatter or comments.",
|
|
42
|
+
},
|
|
43
|
+
schema: [],
|
|
44
|
+
type: "problem",
|
|
45
|
+
},
|
|
46
|
+
name: "no-blank-customization-body",
|
|
47
|
+
});
|
|
48
|
+
export default noBlankCustomizationBodyRule;
|
|
49
|
+
//# sourceMappingURL=no-blank-customization-body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-blank-customization-body.js","sourceRoot":"","sources":["../../src/rules/no-blank-customization-body.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EACH,kBAAkB,EAClB,yBAAyB,GAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACH,8BAA8B,EAC9B,qBAAqB,GACxB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,4BAA4B,GAAsB,iBAAiB,CAAC;IACtE,MAAM,CAAC,OAAO;QACV,OAAO,8BAA8B,CAAC,GAAG,EAAE;YACvC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAEtD,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,yBAAyB,EAAE,CAAC;gBAC9D,OAAO;YACX,CAAC;YAED,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAChE,MAAM,QAAQ,GAAG,WAAW,EAAE,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;YAE9D,IAAI,yBAAyB,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACjD,OAAO;YACX,CAAC;YAED,qBAAqB,CAAC,OAAO,EAAE;gBAC3B,SAAS,EAAE,WAAW;aACzB,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACD,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,cAAc,EAAE;gBACZ,6BAA6B;gBAC7B,wBAAwB;gBACxB,qBAAqB;aACxB;YACD,WAAW,EACP,+FAA+F;YACnG,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,SAAS,EACL,qIAAqI;SAC5I;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,6BAA6B;CACtC,CAAC,CAAC;AAEH,eAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-blank-repository-instructions.d.ts","sourceRoot":"","sources":["../../src/rules/no-blank-repository-instructions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAiB7E,QAAA,MAAM,iCAAiC,EAAE,iBA+CvC,CAAC;AAEH,eAAe,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getCopilotFileKind } from "../_internal/copilot-file-kind.js";
|
|
2
|
+
/**
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
* ESLint rule implementation for `no-blank-repository-instructions`.
|
|
5
|
+
*/
|
|
6
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
7
|
+
import { extractFrontmatter, getMeaningfulMarkdownBody, } from "../_internal/frontmatter.js";
|
|
8
|
+
import { createMarkdownDocumentListener, reportAtDocumentStart, } from "../_internal/markdown-rule.js";
|
|
9
|
+
const noBlankRepositoryInstructionsRule = createCopilotRule({
|
|
10
|
+
create(context) {
|
|
11
|
+
return createMarkdownDocumentListener(() => {
|
|
12
|
+
if (getCopilotFileKind(context.filename) !==
|
|
13
|
+
"repository-instructions") {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
17
|
+
const body = getMeaningfulMarkdownBody(frontmatter?.body ?? context.sourceCode.text);
|
|
18
|
+
if (body.length > 0) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
reportAtDocumentStart(context, {
|
|
22
|
+
messageId: "blankInstructions",
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
defaultOptions: [],
|
|
27
|
+
meta: {
|
|
28
|
+
deprecated: false,
|
|
29
|
+
docs: {
|
|
30
|
+
copilotConfigs: [
|
|
31
|
+
"copilot.configs.recommended",
|
|
32
|
+
"copilot.configs.strict",
|
|
33
|
+
"copilot.configs.all",
|
|
34
|
+
],
|
|
35
|
+
description: "disallow empty repository-wide Copilot instructions files.",
|
|
36
|
+
frozen: false,
|
|
37
|
+
recommended: true,
|
|
38
|
+
requiresTypeChecking: false,
|
|
39
|
+
},
|
|
40
|
+
messages: {
|
|
41
|
+
blankInstructions: "Repository-wide Copilot instructions should contain actionable Markdown guidance instead of being blank.",
|
|
42
|
+
},
|
|
43
|
+
schema: [],
|
|
44
|
+
type: "problem",
|
|
45
|
+
},
|
|
46
|
+
name: "no-blank-repository-instructions",
|
|
47
|
+
});
|
|
48
|
+
export default noBlankRepositoryInstructionsRule;
|
|
49
|
+
//# sourceMappingURL=no-blank-repository-instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-blank-repository-instructions.js","sourceRoot":"","sources":["../../src/rules/no-blank-repository-instructions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EACH,kBAAkB,EAClB,yBAAyB,GAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACH,8BAA8B,EAC9B,qBAAqB,GACxB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,iCAAiC,GAAsB,iBAAiB,CAAC;IAC3E,MAAM,CAAC,OAAO;QACV,OAAO,8BAA8B,CAAC,GAAG,EAAE;YACvC,IACI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC;gBACpC,yBAAyB,EAC3B,CAAC;gBACC,OAAO;YACX,CAAC;YAED,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAChE,MAAM,IAAI,GAAG,yBAAyB,CAClC,WAAW,EAAE,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAC/C,CAAC;YAEF,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAClB,OAAO;YACX,CAAC;YAED,qBAAqB,CAAC,OAAO,EAAE;gBAC3B,SAAS,EAAE,mBAAmB;aACjC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACD,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,cAAc,EAAE;gBACZ,6BAA6B;gBAC7B,wBAAwB;gBACxB,qBAAqB;aACxB;YACD,WAAW,EACP,4DAA4D;YAChE,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,iBAAiB,EACb,0GAA0G;SACjH;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,kCAAkC;CAC3C,CAAC,CAAC;AAEH,eAAe,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-blank-skill-body.d.ts","sourceRoot":"","sources":["../../src/rules/no-blank-skill-body.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAc7E,QAAA,MAAM,oBAAoB,EAAE,iBAyC1B,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { isSkillFilePath } from "../_internal/copilot-file-kind.js";
|
|
2
|
+
/**
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
* ESLint rule implementation for `no-blank-skill-body`.
|
|
5
|
+
*/
|
|
6
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
7
|
+
import { extractFrontmatter } from "../_internal/frontmatter.js";
|
|
8
|
+
import { createMarkdownDocumentListener, reportAtDocumentStart, } from "../_internal/markdown-rule.js";
|
|
9
|
+
const noBlankSkillBodyRule = createCopilotRule({
|
|
10
|
+
create(context) {
|
|
11
|
+
return createMarkdownDocumentListener(() => {
|
|
12
|
+
if (!isSkillFilePath(context.filename)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
16
|
+
const body = frontmatter?.body ?? context.sourceCode.text;
|
|
17
|
+
if (body.trim().length > 0) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
reportAtDocumentStart(context, {
|
|
21
|
+
messageId: "blankSkillBody",
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
defaultOptions: [],
|
|
26
|
+
meta: {
|
|
27
|
+
deprecated: false,
|
|
28
|
+
docs: {
|
|
29
|
+
copilotConfigs: [
|
|
30
|
+
"copilot.configs.recommended",
|
|
31
|
+
"copilot.configs.strict",
|
|
32
|
+
"copilot.configs.all",
|
|
33
|
+
],
|
|
34
|
+
description: "disallow blank Copilot skill definition bodies.",
|
|
35
|
+
frozen: false,
|
|
36
|
+
recommended: true,
|
|
37
|
+
requiresTypeChecking: false,
|
|
38
|
+
},
|
|
39
|
+
messages: {
|
|
40
|
+
blankSkillBody: "Copilot skill definition files should include a non-empty Markdown body with instructions, examples, or guidance.",
|
|
41
|
+
},
|
|
42
|
+
schema: [],
|
|
43
|
+
type: "problem",
|
|
44
|
+
},
|
|
45
|
+
name: "no-blank-skill-body",
|
|
46
|
+
});
|
|
47
|
+
export default noBlankSkillBodyRule;
|
|
48
|
+
//# sourceMappingURL=no-blank-skill-body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-blank-skill-body.js","sourceRoot":"","sources":["../../src/rules/no-blank-skill-body.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACH,8BAA8B,EAC9B,qBAAqB,GACxB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,oBAAoB,GAAsB,iBAAiB,CAAC;IAC9D,MAAM,CAAC,OAAO;QACV,OAAO,8BAA8B,CAAC,GAAG,EAAE;YACvC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACrC,OAAO;YACX,CAAC;YAED,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAChE,MAAM,IAAI,GAAG,WAAW,EAAE,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;YAE1D,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzB,OAAO;YACX,CAAC;YAED,qBAAqB,CAAC,OAAO,EAAE;gBAC3B,SAAS,EAAE,gBAAgB;aAC9B,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACD,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,cAAc,EAAE;gBACZ,6BAA6B;gBAC7B,wBAAwB;gBACxB,qBAAqB;aACxB;YACD,WAAW,EAAE,iDAAiD;YAC9D,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,cAAc,EACV,mHAAmH;SAC1H;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,qBAAqB;CAC9B,CAAC,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-deprecated-agent-infer.d.ts","sourceRoot":"","sources":["../../src/rules/no-deprecated-agent-infer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAiB7E,QAAA,MAAM,0BAA0B,EAAE,iBA4ChC,CAAC;AAEH,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* ESLint rule implementation for `no-deprecated-agent-infer`.
|
|
4
|
+
*/
|
|
5
|
+
import { isCustomAgentFilePath } from "../_internal/copilot-file-kind.js";
|
|
6
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
7
|
+
import { extractFrontmatter, hasFrontmatterField, } from "../_internal/frontmatter.js";
|
|
8
|
+
import { createMarkdownDocumentListener, reportAtDocumentStart, } from "../_internal/markdown-rule.js";
|
|
9
|
+
const noDeprecatedAgentInferRule = createCopilotRule({
|
|
10
|
+
create(context) {
|
|
11
|
+
return createMarkdownDocumentListener(() => {
|
|
12
|
+
if (!isCustomAgentFilePath(context.filename)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
16
|
+
if (frontmatter === null ||
|
|
17
|
+
!hasFrontmatterField(frontmatter, "infer")) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
reportAtDocumentStart(context, {
|
|
21
|
+
messageId: "deprecatedInfer",
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
defaultOptions: [],
|
|
26
|
+
meta: {
|
|
27
|
+
deprecated: false,
|
|
28
|
+
docs: {
|
|
29
|
+
copilotConfigs: [
|
|
30
|
+
"copilot.configs.recommended",
|
|
31
|
+
"copilot.configs.strict",
|
|
32
|
+
"copilot.configs.all",
|
|
33
|
+
],
|
|
34
|
+
description: "disallow deprecated `infer` frontmatter in Copilot custom agent files.",
|
|
35
|
+
frozen: false,
|
|
36
|
+
recommended: true,
|
|
37
|
+
requiresTypeChecking: false,
|
|
38
|
+
},
|
|
39
|
+
messages: {
|
|
40
|
+
deprecatedInfer: "Copilot custom agent files should replace deprecated `infer` frontmatter with `user-invocable` and/or `disable-model-invocation`.",
|
|
41
|
+
},
|
|
42
|
+
schema: [],
|
|
43
|
+
type: "problem",
|
|
44
|
+
},
|
|
45
|
+
name: "no-deprecated-agent-infer",
|
|
46
|
+
});
|
|
47
|
+
export default noDeprecatedAgentInferRule;
|
|
48
|
+
//# sourceMappingURL=no-deprecated-agent-infer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-deprecated-agent-infer.js","sourceRoot":"","sources":["../../src/rules/no-deprecated-agent-infer.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EACH,kBAAkB,EAClB,mBAAmB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACH,8BAA8B,EAC9B,qBAAqB,GACxB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,0BAA0B,GAAsB,iBAAiB,CAAC;IACpE,MAAM,CAAC,OAAO;QACV,OAAO,8BAA8B,CAAC,GAAG,EAAE;YACvC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC3C,OAAO;YACX,CAAC;YAED,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAEhE,IACI,WAAW,KAAK,IAAI;gBACpB,CAAC,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,EAC5C,CAAC;gBACC,OAAO;YACX,CAAC;YAED,qBAAqB,CAAC,OAAO,EAAE;gBAC3B,SAAS,EAAE,iBAAiB;aAC/B,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACD,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,cAAc,EAAE;gBACZ,6BAA6B;gBAC7B,wBAAwB;gBACxB,qBAAqB;aACxB;YACD,WAAW,EACP,wEAAwE;YAC5E,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,eAAe,EACX,mIAAmI;SAC1I;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,2BAA2B;CACpC,CAAC,CAAC;AAEH,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-duplicate-agent-names.d.ts","sourceRoot":"","sources":["../../src/rules/no-duplicate-agent-names.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAwB7E,QAAA,MAAM,yBAAyB,EAAE,iBAqF/B,CAAC;AAEH,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* ESLint rule implementation for `no-duplicate-agent-names`.
|
|
4
|
+
*/
|
|
5
|
+
import * as fs from "node:fs";
|
|
6
|
+
import * as path from "node:path";
|
|
7
|
+
import { getAgentName, normalizeNameForComparison, } from "../_internal/copilot-customization-names.js";
|
|
8
|
+
import { findRepositoryRoot, isCustomAgentFilePath, } from "../_internal/copilot-file-kind.js";
|
|
9
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
10
|
+
import { collectDuplicateNameGroups } from "../_internal/duplicate-names.js";
|
|
11
|
+
import { listFilesRecursively } from "../_internal/file-system.js";
|
|
12
|
+
import { extractFrontmatter } from "../_internal/frontmatter.js";
|
|
13
|
+
import { createMarkdownDocumentListener, reportAtDocumentStart, } from "../_internal/markdown-rule.js";
|
|
14
|
+
const normalizeRelativeFilePath = (repositoryRoot, filePath) => path.relative(repositoryRoot, filePath).replaceAll("\\", "/");
|
|
15
|
+
const noDuplicateAgentNamesRule = createCopilotRule({
|
|
16
|
+
create(context) {
|
|
17
|
+
return createMarkdownDocumentListener(() => {
|
|
18
|
+
if (!isCustomAgentFilePath(context.filename)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const repositoryRoot = findRepositoryRoot(context.filename);
|
|
22
|
+
const agentDirectory = path.join(repositoryRoot, ".github", "agents");
|
|
23
|
+
const agentFiles = listFilesRecursively(agentDirectory, (filePath) => filePath.endsWith(".agent.md"));
|
|
24
|
+
const duplicateGroups = collectDuplicateNameGroups(agentFiles.map((filePath) => {
|
|
25
|
+
const sourceText = context.filename === filePath
|
|
26
|
+
? context.sourceCode.text
|
|
27
|
+
: fs.readFileSync(filePath, "utf8");
|
|
28
|
+
return {
|
|
29
|
+
filePath,
|
|
30
|
+
name: getAgentName(filePath, extractFrontmatter(sourceText)),
|
|
31
|
+
};
|
|
32
|
+
}), normalizeNameForComparison);
|
|
33
|
+
const currentAgentName = getAgentName(context.filename, extractFrontmatter(context.sourceCode.text));
|
|
34
|
+
const duplicateGroup = duplicateGroups.get(normalizeNameForComparison(currentAgentName));
|
|
35
|
+
if (duplicateGroup === undefined) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
reportAtDocumentStart(context, {
|
|
39
|
+
data: {
|
|
40
|
+
files: duplicateGroup
|
|
41
|
+
.map((entry) => normalizeRelativeFilePath(repositoryRoot, entry.filePath))
|
|
42
|
+
.join(", "),
|
|
43
|
+
name: currentAgentName,
|
|
44
|
+
},
|
|
45
|
+
messageId: "duplicateAgentName",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
defaultOptions: [],
|
|
50
|
+
meta: {
|
|
51
|
+
deprecated: false,
|
|
52
|
+
docs: {
|
|
53
|
+
copilotConfigs: [
|
|
54
|
+
"copilot.configs.recommended",
|
|
55
|
+
"copilot.configs.strict",
|
|
56
|
+
"copilot.configs.all",
|
|
57
|
+
],
|
|
58
|
+
description: "disallow duplicate effective custom-agent names across workspace custom-agent files.",
|
|
59
|
+
frozen: false,
|
|
60
|
+
recommended: true,
|
|
61
|
+
requiresTypeChecking: false,
|
|
62
|
+
},
|
|
63
|
+
messages: {
|
|
64
|
+
duplicateAgentName: "Copilot custom-agent name `{{name}}` is duplicated across agent files: {{files}}.",
|
|
65
|
+
},
|
|
66
|
+
schema: [],
|
|
67
|
+
type: "problem",
|
|
68
|
+
},
|
|
69
|
+
name: "no-duplicate-agent-names",
|
|
70
|
+
});
|
|
71
|
+
export default noDuplicateAgentNamesRule;
|
|
72
|
+
//# sourceMappingURL=no-duplicate-agent-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-duplicate-agent-names.js","sourceRoot":"","sources":["../../src/rules/no-duplicate-agent-names.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,OAAO,EACH,YAAY,EACZ,0BAA0B,GAC7B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACH,kBAAkB,EAClB,qBAAqB,GACx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
+
{"version":3,"file":"no-duplicate-prompt-names.d.ts","sourceRoot":"","sources":["../../src/rules/no-duplicate-prompt-names.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAqB7E,QAAA,MAAM,0BAA0B,EAAE,iBAqFhC,CAAC;AAEH,eAAe,0BAA0B,CAAC"}
|