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 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-prompt-tools.d.ts","sourceRoot":"","sources":["../../src/rules/require-valid-prompt-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAkC7E,QAAA,MAAM,2BAA2B,EAAE,iBAwDjC,CAAC;AAEH,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { getCopilotFileKind } from "../_internal/copilot-file-kind.js";
|
|
2
|
+
/**
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
* ESLint rule implementation for `require-valid-prompt-tools`.
|
|
5
|
+
*/
|
|
6
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
7
|
+
import { extractFrontmatter, getFrontmatterList, getFrontmatterScalar, hasFrontmatterField, } from "../_internal/frontmatter.js";
|
|
8
|
+
import { createMarkdownDocumentListener, reportAtDocumentStart, } from "../_internal/markdown-rule.js";
|
|
9
|
+
const formatToolsValue = (scalarValue, listValue) => {
|
|
10
|
+
if (scalarValue !== undefined) {
|
|
11
|
+
return scalarValue;
|
|
12
|
+
}
|
|
13
|
+
if (listValue !== undefined) {
|
|
14
|
+
return `[${listValue.join(", ")}]`;
|
|
15
|
+
}
|
|
16
|
+
return "(empty)";
|
|
17
|
+
};
|
|
18
|
+
const requireValidPromptToolsRule = createCopilotRule({
|
|
19
|
+
create(context) {
|
|
20
|
+
return createMarkdownDocumentListener(() => {
|
|
21
|
+
if (getCopilotFileKind(context.filename) !== "prompt") {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
25
|
+
if (frontmatter === null ||
|
|
26
|
+
!hasFrontmatterField(frontmatter, "tools")) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const tools = getFrontmatterList(frontmatter, "tools");
|
|
30
|
+
if (tools !== undefined && tools.length > 0) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
reportAtDocumentStart(context, {
|
|
34
|
+
data: {
|
|
35
|
+
toolsValue: formatToolsValue(getFrontmatterScalar(frontmatter, "tools"), tools),
|
|
36
|
+
},
|
|
37
|
+
messageId: "invalidPromptTools",
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
defaultOptions: [],
|
|
42
|
+
meta: {
|
|
43
|
+
deprecated: false,
|
|
44
|
+
docs: {
|
|
45
|
+
copilotConfigs: [
|
|
46
|
+
"copilot.configs.recommended",
|
|
47
|
+
"copilot.configs.strict",
|
|
48
|
+
"copilot.configs.all",
|
|
49
|
+
],
|
|
50
|
+
description: "require Copilot prompt-file `tools` metadata to be a non-empty list of tool or tool-set names when present.",
|
|
51
|
+
frozen: false,
|
|
52
|
+
recommended: true,
|
|
53
|
+
requiresTypeChecking: false,
|
|
54
|
+
},
|
|
55
|
+
messages: {
|
|
56
|
+
invalidPromptTools: "Copilot prompt-file `tools` metadata must be a non-empty list of tool or tool-set names when present (current value: `{{toolsValue}}`).",
|
|
57
|
+
},
|
|
58
|
+
schema: [],
|
|
59
|
+
type: "problem",
|
|
60
|
+
},
|
|
61
|
+
name: "require-valid-prompt-tools",
|
|
62
|
+
});
|
|
63
|
+
export default requireValidPromptToolsRule;
|
|
64
|
+
//# sourceMappingURL=require-valid-prompt-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-prompt-tools.js","sourceRoot":"","sources":["../../src/rules/require-valid-prompt-tools.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,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACH,8BAA8B,EAC9B,qBAAqB,GACxB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,gBAAgB,GAAG,CACrB,WAA+B,EAC/B,SAAwC,EAClC,EAAE;IACR,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IACvC,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAsB,iBAAiB,CAAC;IACrE,MAAM,CAAC,OAAO;QACV,OAAO,8BAA8B,CAAC,GAAG,EAAE;YACvC,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,QAAQ,EAAE,CAAC;gBACpD,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,MAAM,KAAK,GAAG,kBAAkB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAEvD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC1C,OAAO;YACX,CAAC;YAED,qBAAqB,CAAC,OAAO,EAAE;gBAC3B,IAAI,EAAE;oBACF,UAAU,EAAE,gBAAgB,CACxB,oBAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,EAC1C,KAAK,CACR;iBACJ;gBACD,SAAS,EAAE,oBAAoB;aAClC,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,6GAA6G;YACjH,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,kBAAkB,EACd,yIAAyI;SAChJ;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,4BAA4B;CACrC,CAAC,CAAC;AAEH,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CopilotRuleModule } from "../_internal/create-copilot-rule.js";
|
|
2
|
+
declare const requireValidRepositoryHookCommandTypeRule: CopilotRuleModule;
|
|
3
|
+
export default requireValidRepositoryHookCommandTypeRule;
|
|
4
|
+
//# sourceMappingURL=require-valid-repository-hook-command-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-repository-hook-command-type.d.ts","sourceRoot":"","sources":["../../src/rules/require-valid-repository-hook-command-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAiB7E,QAAA,MAAM,yCAAyC,EAAE,iBA0D3C,CAAC;AAEP,eAAe,yCAAyC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* ESLint rule implementation for `require-valid-repository-hook-command-type`.
|
|
4
|
+
*/
|
|
5
|
+
import { isRepositoryHookFilePath } from "../_internal/copilot-file-kind.js";
|
|
6
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
7
|
+
import { reportAtDocumentStart } from "../_internal/markdown-rule.js";
|
|
8
|
+
import { formatJsonValue, getRepositoryHookObjects, isJsonString, isRepositoryHookType, parseJsonText, } from "../_internal/repository-hooks-json.js";
|
|
9
|
+
const requireValidRepositoryHookCommandTypeRule = createCopilotRule({
|
|
10
|
+
create(context) {
|
|
11
|
+
return {
|
|
12
|
+
Document() {
|
|
13
|
+
if (!isRepositoryHookFilePath(context.filename)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const root = parseJsonText(context.sourceCode.text);
|
|
17
|
+
const invalidHook = getRepositoryHookObjects(root).find(({ hook }) => {
|
|
18
|
+
const typeValue = hook["type"];
|
|
19
|
+
return (!isJsonString(typeValue) ||
|
|
20
|
+
!isRepositoryHookType(typeValue));
|
|
21
|
+
});
|
|
22
|
+
if (invalidHook === undefined) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
reportAtDocumentStart(context, {
|
|
26
|
+
data: {
|
|
27
|
+
eventName: invalidHook.eventName,
|
|
28
|
+
type: formatJsonValue(invalidHook.hook["type"]),
|
|
29
|
+
},
|
|
30
|
+
messageId: "invalidRepositoryHookType",
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
defaultOptions: [],
|
|
36
|
+
meta: {
|
|
37
|
+
deprecated: false,
|
|
38
|
+
docs: {
|
|
39
|
+
copilotConfigs: [
|
|
40
|
+
"copilot.configs.recommended",
|
|
41
|
+
"copilot.configs.strict",
|
|
42
|
+
"copilot.configs.all",
|
|
43
|
+
],
|
|
44
|
+
description: "require repository hook definitions to declare a supported `type` value such as `command` or `prompt`.",
|
|
45
|
+
frozen: false,
|
|
46
|
+
recommended: true,
|
|
47
|
+
requiresTypeChecking: false,
|
|
48
|
+
},
|
|
49
|
+
messages: {
|
|
50
|
+
invalidRepositoryHookType: "Repository hook definitions for `{{eventName}}` must declare a supported `type` such as `command` or `prompt` (current value: `{{type}}`).",
|
|
51
|
+
},
|
|
52
|
+
schema: [],
|
|
53
|
+
type: "problem",
|
|
54
|
+
},
|
|
55
|
+
name: "require-valid-repository-hook-command-type",
|
|
56
|
+
});
|
|
57
|
+
export default requireValidRepositoryHookCommandTypeRule;
|
|
58
|
+
//# sourceMappingURL=require-valid-repository-hook-command-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-repository-hook-command-type.js","sourceRoot":"","sources":["../../src/rules/require-valid-repository-hook-command-type.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACH,eAAe,EACf,wBAAwB,EACxB,YAAY,EACZ,oBAAoB,EACpB,aAAa,GAChB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,yCAAyC,GAC3C,iBAAiB,CAAC;IACd,MAAM,CAAC,OAAO;QACV,OAAO;YACH,QAAQ;gBACJ,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC9C,OAAO;gBACX,CAAC;gBAED,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACpD,MAAM,WAAW,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC,IAAI,CACnD,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;oBACT,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;oBAE/B,OAAO,CACH,CAAC,YAAY,CAAC,SAAS,CAAC;wBACxB,CAAC,oBAAoB,CAAC,SAAS,CAAC,CACnC,CAAC;gBACN,CAAC,CACJ,CAAC;gBAEF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;oBAC5B,OAAO;gBACX,CAAC;gBAED,qBAAqB,CAAC,OAAO,EAAE;oBAC3B,IAAI,EAAE;wBACF,SAAS,EAAE,WAAW,CAAC,SAAS;wBAChC,IAAI,EAAE,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;qBAClD;oBACD,SAAS,EAAE,2BAA2B;iBACzC,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,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,wGAAwG;YAC5G,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,yBAAyB,EACrB,4IAA4I;SACnJ;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,4CAA4C;CACrD,CAAC,CAAC;AAEP,eAAe,yCAAyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-repository-hook-env.d.ts","sourceRoot":"","sources":["../../src/rules/require-valid-repository-hook-env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAgB7E,QAAA,MAAM,iCAAiC,EAAE,iBAsDvC,CAAC;AAEH,eAAe,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* ESLint rule implementation for `require-valid-repository-hook-env`.
|
|
4
|
+
*/
|
|
5
|
+
import { isRepositoryHookFilePath } from "../_internal/copilot-file-kind.js";
|
|
6
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
7
|
+
import { reportAtDocumentStart } from "../_internal/markdown-rule.js";
|
|
8
|
+
import { formatJsonValue, getRepositoryHookObjects, isJsonObject, parseJsonText, } from "../_internal/repository-hooks-json.js";
|
|
9
|
+
const requireValidRepositoryHookEnvRule = createCopilotRule({
|
|
10
|
+
create(context) {
|
|
11
|
+
return {
|
|
12
|
+
Document() {
|
|
13
|
+
if (!isRepositoryHookFilePath(context.filename)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const root = parseJsonText(context.sourceCode.text);
|
|
17
|
+
const invalidHook = getRepositoryHookObjects(root).find(({ hook }) => {
|
|
18
|
+
const env = hook["env"];
|
|
19
|
+
return env !== undefined && !isJsonObject(env);
|
|
20
|
+
});
|
|
21
|
+
if (invalidHook === undefined) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
reportAtDocumentStart(context, {
|
|
25
|
+
data: {
|
|
26
|
+
env: formatJsonValue(invalidHook.hook["env"]),
|
|
27
|
+
eventName: invalidHook.eventName,
|
|
28
|
+
},
|
|
29
|
+
messageId: "invalidRepositoryHookEnv",
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
defaultOptions: [],
|
|
35
|
+
meta: {
|
|
36
|
+
deprecated: false,
|
|
37
|
+
docs: {
|
|
38
|
+
copilotConfigs: [
|
|
39
|
+
"copilot.configs.recommended",
|
|
40
|
+
"copilot.configs.strict",
|
|
41
|
+
"copilot.configs.all",
|
|
42
|
+
],
|
|
43
|
+
description: "require repository hook `env` values to be JSON objects when present.",
|
|
44
|
+
frozen: false,
|
|
45
|
+
recommended: true,
|
|
46
|
+
requiresTypeChecking: false,
|
|
47
|
+
},
|
|
48
|
+
messages: {
|
|
49
|
+
invalidRepositoryHookEnv: "Repository hook `env` for `{{eventName}}` must be a JSON object when present (current value: `{{env}}`).",
|
|
50
|
+
},
|
|
51
|
+
schema: [],
|
|
52
|
+
type: "problem",
|
|
53
|
+
},
|
|
54
|
+
name: "require-valid-repository-hook-env",
|
|
55
|
+
});
|
|
56
|
+
export default requireValidRepositoryHookEnvRule;
|
|
57
|
+
//# sourceMappingURL=require-valid-repository-hook-env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-repository-hook-env.js","sourceRoot":"","sources":["../../src/rules/require-valid-repository-hook-env.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACH,eAAe,EACf,wBAAwB,EACxB,YAAY,EACZ,aAAa,GAChB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,iCAAiC,GAAsB,iBAAiB,CAAC;IAC3E,MAAM,CAAC,OAAO;QACV,OAAO;YACH,QAAQ;gBACJ,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC9C,OAAO;gBACX,CAAC;gBAED,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACpD,MAAM,WAAW,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC,IAAI,CACnD,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;oBACT,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;oBAExB,OAAO,GAAG,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;gBACnD,CAAC,CACJ,CAAC;gBAEF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;oBAC5B,OAAO;gBACX,CAAC;gBAED,qBAAqB,CAAC,OAAO,EAAE;oBAC3B,IAAI,EAAE;wBACF,GAAG,EAAE,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;wBAC7C,SAAS,EAAE,WAAW,CAAC,SAAS;qBACnC;oBACD,SAAS,EAAE,0BAA0B;iBACxC,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,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,uEAAuE;YAC3E,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,wBAAwB,EACpB,0GAA0G;SACjH;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,mCAAmC;CAC5C,CAAC,CAAC;AAEH,eAAe,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CopilotRuleModule } from "../_internal/create-copilot-rule.js";
|
|
2
|
+
declare const requireValidRepositoryHookEventsRule: CopilotRuleModule;
|
|
3
|
+
export default requireValidRepositoryHookEventsRule;
|
|
4
|
+
//# sourceMappingURL=require-valid-repository-hook-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-repository-hook-events.d.ts","sourceRoot":"","sources":["../../src/rules/require-valid-repository-hook-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAe7E,QAAA,MAAM,oCAAoC,EAAE,iBAoDtC,CAAC;AAEP,eAAe,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* ESLint rule implementation for `require-valid-repository-hook-events`.
|
|
4
|
+
*/
|
|
5
|
+
import { isRepositoryHookFilePath } from "../_internal/copilot-file-kind.js";
|
|
6
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
7
|
+
import { reportAtDocumentStart } from "../_internal/markdown-rule.js";
|
|
8
|
+
import { getRepositoryHookEventEntries, isRepositoryHookEventName, parseJsonText, } from "../_internal/repository-hooks-json.js";
|
|
9
|
+
const requireValidRepositoryHookEventsRule = createCopilotRule({
|
|
10
|
+
create(context) {
|
|
11
|
+
return {
|
|
12
|
+
Document() {
|
|
13
|
+
if (!isRepositoryHookFilePath(context.filename)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const root = parseJsonText(context.sourceCode.text);
|
|
17
|
+
const invalidEventName = getRepositoryHookEventEntries(root)
|
|
18
|
+
.map(([eventName]) => eventName)
|
|
19
|
+
.find((eventName) => !isRepositoryHookEventName(eventName));
|
|
20
|
+
if (invalidEventName === undefined) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
reportAtDocumentStart(context, {
|
|
24
|
+
data: {
|
|
25
|
+
eventName: invalidEventName,
|
|
26
|
+
},
|
|
27
|
+
messageId: "invalidRepositoryHookEvent",
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
defaultOptions: [],
|
|
33
|
+
meta: {
|
|
34
|
+
deprecated: false,
|
|
35
|
+
docs: {
|
|
36
|
+
copilotConfigs: [
|
|
37
|
+
"copilot.configs.recommended",
|
|
38
|
+
"copilot.configs.strict",
|
|
39
|
+
"copilot.configs.all",
|
|
40
|
+
],
|
|
41
|
+
description: "require repository hook configuration files to use supported hook event names.",
|
|
42
|
+
frozen: false,
|
|
43
|
+
recommended: true,
|
|
44
|
+
requiresTypeChecking: false,
|
|
45
|
+
},
|
|
46
|
+
messages: {
|
|
47
|
+
invalidRepositoryHookEvent: "Repository hook configuration files should use a supported hook event name, not `{{eventName}}`.",
|
|
48
|
+
},
|
|
49
|
+
schema: [],
|
|
50
|
+
type: "problem",
|
|
51
|
+
},
|
|
52
|
+
name: "require-valid-repository-hook-events",
|
|
53
|
+
});
|
|
54
|
+
export default requireValidRepositoryHookEventsRule;
|
|
55
|
+
//# sourceMappingURL=require-valid-repository-hook-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-repository-hook-events.js","sourceRoot":"","sources":["../../src/rules/require-valid-repository-hook-events.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACH,6BAA6B,EAC7B,yBAAyB,EACzB,aAAa,GAChB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,oCAAoC,GACtC,iBAAiB,CAAC;IACd,MAAM,CAAC,OAAO;QACV,OAAO;YACH,QAAQ;gBACJ,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC9C,OAAO;gBACX,CAAC;gBAED,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACpD,MAAM,gBAAgB,GAAG,6BAA6B,CAAC,IAAI,CAAC;qBACvD,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC;qBAC/B,IAAI,CACD,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,yBAAyB,CAAC,SAAS,CAAC,CACvD,CAAC;gBAEN,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;oBACjC,OAAO;gBACX,CAAC;gBAED,qBAAqB,CAAC,OAAO,EAAE;oBAC3B,IAAI,EAAE;wBACF,SAAS,EAAE,gBAAgB;qBAC9B;oBACD,SAAS,EAAE,4BAA4B;iBAC1C,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,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,gFAAgF;YACpF,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,0BAA0B,EACtB,kGAAkG;SACzG;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,sCAAsC;CAC/C,CAAC,CAAC;AAEP,eAAe,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CopilotRuleModule } from "../_internal/create-copilot-rule.js";
|
|
2
|
+
declare const requireValidRepositoryHookTimeoutsRule: CopilotRuleModule;
|
|
3
|
+
export default requireValidRepositoryHookTimeoutsRule;
|
|
4
|
+
//# sourceMappingURL=require-valid-repository-hook-timeouts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-repository-hook-timeouts.d.ts","sourceRoot":"","sources":["../../src/rules/require-valid-repository-hook-timeouts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAkB7E,QAAA,MAAM,sCAAsC,EAAE,iBA4DxC,CAAC;AAEP,eAAe,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* ESLint rule implementation for `require-valid-repository-hook-timeouts`.
|
|
4
|
+
*/
|
|
5
|
+
import { isRepositoryHookFilePath } from "../_internal/copilot-file-kind.js";
|
|
6
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
7
|
+
import { reportAtDocumentStart } from "../_internal/markdown-rule.js";
|
|
8
|
+
import { formatJsonValue, getRepositoryHookObjects, parseJsonText, } from "../_internal/repository-hooks-json.js";
|
|
9
|
+
const isValidTimeoutSeconds = (value) => typeof value === "number" && Number.isInteger(value) && value > 0;
|
|
10
|
+
const requireValidRepositoryHookTimeoutsRule = createCopilotRule({
|
|
11
|
+
create(context) {
|
|
12
|
+
return {
|
|
13
|
+
Document() {
|
|
14
|
+
if (!isRepositoryHookFilePath(context.filename)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const root = parseJsonText(context.sourceCode.text);
|
|
18
|
+
const invalidHook = getRepositoryHookObjects(root).find(({ hook }) => {
|
|
19
|
+
const timeout = hook["timeoutSec"];
|
|
20
|
+
return (timeout !== undefined &&
|
|
21
|
+
!isValidTimeoutSeconds(timeout));
|
|
22
|
+
});
|
|
23
|
+
if (invalidHook === undefined) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
reportAtDocumentStart(context, {
|
|
27
|
+
data: {
|
|
28
|
+
eventName: invalidHook.eventName,
|
|
29
|
+
timeout: formatJsonValue(invalidHook.hook["timeoutSec"]),
|
|
30
|
+
},
|
|
31
|
+
messageId: "invalidRepositoryHookTimeout",
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
defaultOptions: [],
|
|
37
|
+
meta: {
|
|
38
|
+
deprecated: false,
|
|
39
|
+
docs: {
|
|
40
|
+
copilotConfigs: [
|
|
41
|
+
"copilot.configs.recommended",
|
|
42
|
+
"copilot.configs.strict",
|
|
43
|
+
"copilot.configs.all",
|
|
44
|
+
],
|
|
45
|
+
description: "require repository hook `timeoutSec` values to be positive integers when present.",
|
|
46
|
+
frozen: false,
|
|
47
|
+
recommended: true,
|
|
48
|
+
requiresTypeChecking: false,
|
|
49
|
+
},
|
|
50
|
+
messages: {
|
|
51
|
+
invalidRepositoryHookTimeout: "Repository hook `timeoutSec` for `{{eventName}}` must be a positive integer when present (current value: `{{timeout}}`).",
|
|
52
|
+
},
|
|
53
|
+
schema: [],
|
|
54
|
+
type: "problem",
|
|
55
|
+
},
|
|
56
|
+
name: "require-valid-repository-hook-timeouts",
|
|
57
|
+
});
|
|
58
|
+
export default requireValidRepositoryHookTimeoutsRule;
|
|
59
|
+
//# sourceMappingURL=require-valid-repository-hook-timeouts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-repository-hook-timeouts.js","sourceRoot":"","sources":["../../src/rules/require-valid-repository-hook-timeouts.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACH,eAAe,EACf,wBAAwB,EACxB,aAAa,GAChB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,qBAAqB,GAAG,CAAC,KAAc,EAAmB,EAAE,CAC9D,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;AAEtE,MAAM,sCAAsC,GACxC,iBAAiB,CAAC;IACd,MAAM,CAAC,OAAO;QACV,OAAO;YACH,QAAQ;gBACJ,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC9C,OAAO;gBACX,CAAC;gBAED,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACpD,MAAM,WAAW,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC,IAAI,CACnD,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;oBACT,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;oBAEnC,OAAO,CACH,OAAO,KAAK,SAAS;wBACrB,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAClC,CAAC;gBACN,CAAC,CACJ,CAAC;gBAEF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;oBAC5B,OAAO;gBACX,CAAC;gBAED,qBAAqB,CAAC,OAAO,EAAE;oBAC3B,IAAI,EAAE;wBACF,SAAS,EAAE,WAAW,CAAC,SAAS;wBAChC,OAAO,EAAE,eAAe,CACpB,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CACjC;qBACJ;oBACD,SAAS,EAAE,8BAA8B;iBAC5C,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,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,mFAAmF;YACvF,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,4BAA4B,EACxB,0HAA0H;SACjI;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,wCAAwC;CACjD,CAAC,CAAC;AAEP,eAAe,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CopilotRuleModule } from "../_internal/create-copilot-rule.js";
|
|
2
|
+
declare const requireValidRepositoryHookVersionRule: CopilotRuleModule;
|
|
3
|
+
export default requireValidRepositoryHookVersionRule;
|
|
4
|
+
//# sourceMappingURL=require-valid-repository-hook-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-repository-hook-version.d.ts","sourceRoot":"","sources":["../../src/rules/require-valid-repository-hook-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAe7E,QAAA,MAAM,qCAAqC,EAAE,iBAgDvC,CAAC;AAEP,eAAe,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* ESLint rule implementation for `require-valid-repository-hook-version`.
|
|
4
|
+
*/
|
|
5
|
+
import { isRepositoryHookFilePath } from "../_internal/copilot-file-kind.js";
|
|
6
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
7
|
+
import { reportAtDocumentStart } from "../_internal/markdown-rule.js";
|
|
8
|
+
import { formatJsonValue, getRepositoryHooksVersionValue, parseJsonText, } from "../_internal/repository-hooks-json.js";
|
|
9
|
+
const requireValidRepositoryHookVersionRule = createCopilotRule({
|
|
10
|
+
create(context) {
|
|
11
|
+
return {
|
|
12
|
+
Document() {
|
|
13
|
+
if (!isRepositoryHookFilePath(context.filename)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const root = parseJsonText(context.sourceCode.text);
|
|
17
|
+
const versionValue = getRepositoryHooksVersionValue(root);
|
|
18
|
+
if (versionValue === 1) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
reportAtDocumentStart(context, {
|
|
22
|
+
data: {
|
|
23
|
+
version: formatJsonValue(versionValue),
|
|
24
|
+
},
|
|
25
|
+
messageId: "invalidRepositoryHookVersion",
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
defaultOptions: [],
|
|
31
|
+
meta: {
|
|
32
|
+
deprecated: false,
|
|
33
|
+
docs: {
|
|
34
|
+
copilotConfigs: [
|
|
35
|
+
"copilot.configs.recommended",
|
|
36
|
+
"copilot.configs.strict",
|
|
37
|
+
"copilot.configs.all",
|
|
38
|
+
],
|
|
39
|
+
description: "require repository hook configuration files to declare `version: 1`.",
|
|
40
|
+
frozen: false,
|
|
41
|
+
recommended: true,
|
|
42
|
+
requiresTypeChecking: false,
|
|
43
|
+
},
|
|
44
|
+
messages: {
|
|
45
|
+
invalidRepositoryHookVersion: "Repository hook configuration files must declare `version: 1` (current value: `{{version}}`).",
|
|
46
|
+
},
|
|
47
|
+
schema: [],
|
|
48
|
+
type: "problem",
|
|
49
|
+
},
|
|
50
|
+
name: "require-valid-repository-hook-version",
|
|
51
|
+
});
|
|
52
|
+
export default requireValidRepositoryHookVersionRule;
|
|
53
|
+
//# sourceMappingURL=require-valid-repository-hook-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-repository-hook-version.js","sourceRoot":"","sources":["../../src/rules/require-valid-repository-hook-version.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACH,eAAe,EACf,8BAA8B,EAC9B,aAAa,GAChB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,qCAAqC,GACvC,iBAAiB,CAAC;IACd,MAAM,CAAC,OAAO;QACV,OAAO;YACH,QAAQ;gBACJ,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC9C,OAAO;gBACX,CAAC;gBAED,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACpD,MAAM,YAAY,GAAG,8BAA8B,CAAC,IAAI,CAAC,CAAC;gBAE1D,IAAI,YAAY,KAAK,CAAC,EAAE,CAAC;oBACrB,OAAO;gBACX,CAAC;gBAED,qBAAqB,CAAC,OAAO,EAAE;oBAC3B,IAAI,EAAE;wBACF,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC;qBACzC;oBACD,SAAS,EAAE,8BAA8B;iBAC5C,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,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,sEAAsE;YAC1E,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,4BAA4B,EACxB,+FAA+F;SACtG;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,uCAAuC;CAChD,CAAC,CAAC;AAEP,eAAe,qCAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-skill-directory-name.d.ts","sourceRoot":"","sources":["../../src/rules/require-valid-skill-directory-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAiB7E,QAAA,MAAM,kCAAkC,EAAE,iBA8CzC,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { getSkillDirectoryName, isValidSkillIdentifier, } from "../_internal/copilot-customization-names.js";
|
|
2
|
+
import { isSkillFilePath } from "../_internal/copilot-file-kind.js";
|
|
3
|
+
/**
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
* ESLint rule implementation for `require-valid-skill-directory-name`.
|
|
6
|
+
*/
|
|
7
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
8
|
+
import { createMarkdownDocumentListener, reportAtDocumentStart, } from "../_internal/markdown-rule.js";
|
|
9
|
+
const requireValidSkillDirectoryNameRule = createCopilotRule({
|
|
10
|
+
create(context) {
|
|
11
|
+
return createMarkdownDocumentListener(() => {
|
|
12
|
+
if (!isSkillFilePath(context.filename)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const directoryName = getSkillDirectoryName(context.filename);
|
|
16
|
+
if (isValidSkillIdentifier(directoryName)) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
reportAtDocumentStart(context, {
|
|
20
|
+
data: {
|
|
21
|
+
directoryName,
|
|
22
|
+
},
|
|
23
|
+
messageId: "invalidSkillDirectoryName",
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
defaultOptions: [],
|
|
28
|
+
meta: {
|
|
29
|
+
deprecated: false,
|
|
30
|
+
docs: {
|
|
31
|
+
copilotConfigs: [
|
|
32
|
+
"copilot.configs.recommended",
|
|
33
|
+
"copilot.configs.strict",
|
|
34
|
+
"copilot.configs.all",
|
|
35
|
+
],
|
|
36
|
+
description: "require Copilot skill directory names to use the documented lowercase-hyphen form.",
|
|
37
|
+
frozen: false,
|
|
38
|
+
recommended: true,
|
|
39
|
+
requiresTypeChecking: false,
|
|
40
|
+
},
|
|
41
|
+
messages: {
|
|
42
|
+
invalidSkillDirectoryName: "Copilot skill directory names must use lowercase letters, digits, and hyphens only (current directory: `{{directoryName}}`).",
|
|
43
|
+
},
|
|
44
|
+
schema: [],
|
|
45
|
+
type: "problem",
|
|
46
|
+
},
|
|
47
|
+
name: "require-valid-skill-directory-name",
|
|
48
|
+
});
|
|
49
|
+
export default requireValidSkillDirectoryNameRule;
|
|
50
|
+
//# sourceMappingURL=require-valid-skill-directory-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-skill-directory-name.js","sourceRoot":"","sources":["../../src/rules/require-valid-skill-directory-name.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,qBAAqB,EACrB,sBAAsB,GACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EACH,8BAA8B,EAC9B,qBAAqB,GACxB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,kCAAkC,GAAsB,iBAAiB,CAC3E;IACI,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,aAAa,GAAG,qBAAqB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAE9D,IAAI,sBAAsB,CAAC,aAAa,CAAC,EAAE,CAAC;gBACxC,OAAO;YACX,CAAC;YAED,qBAAqB,CAAC,OAAO,EAAE;gBAC3B,IAAI,EAAE;oBACF,aAAa;iBAChB;gBACD,SAAS,EAAE,2BAA2B;aACzC,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,oFAAoF;YACxF,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,IAAI;YACjB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,yBAAyB,EACrB,8HAA8H;SACrI;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,oCAAoC;CAC7C,CACJ,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-skill-license.d.ts","sourceRoot":"","sources":["../../src/rules/require-valid-skill-license.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAkB7E,QAAA,MAAM,4BAA4B,EAAE,iBA4ClC,CAAC;AAEH,eAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { isSkillFilePath } from "../_internal/copilot-file-kind.js";
|
|
2
|
+
/**
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
* ESLint rule implementation for `require-valid-skill-license`.
|
|
5
|
+
*/
|
|
6
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
7
|
+
import { extractFrontmatter, getFrontmatterScalar, hasFrontmatterField, } from "../_internal/frontmatter.js";
|
|
8
|
+
import { createMarkdownDocumentListener, reportAtDocumentStart, } from "../_internal/markdown-rule.js";
|
|
9
|
+
const requireValidSkillLicenseRule = createCopilotRule({
|
|
10
|
+
create(context) {
|
|
11
|
+
return createMarkdownDocumentListener(() => {
|
|
12
|
+
if (!isSkillFilePath(context.filename)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
16
|
+
if (frontmatter === null ||
|
|
17
|
+
!hasFrontmatterField(frontmatter, "license")) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (getFrontmatterScalar(frontmatter, "license") !== undefined) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
reportAtDocumentStart(context, {
|
|
24
|
+
messageId: "invalidSkillLicense",
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
defaultOptions: [],
|
|
29
|
+
meta: {
|
|
30
|
+
deprecated: false,
|
|
31
|
+
docs: {
|
|
32
|
+
copilotConfigs: ["copilot.configs.strict", "copilot.configs.all"],
|
|
33
|
+
description: "require optional Copilot skill `license` metadata to be a non-empty scalar when present.",
|
|
34
|
+
frozen: false,
|
|
35
|
+
recommended: false,
|
|
36
|
+
requiresTypeChecking: false,
|
|
37
|
+
},
|
|
38
|
+
messages: {
|
|
39
|
+
invalidSkillLicense: "Copilot skill `license` metadata must be a non-empty scalar when present.",
|
|
40
|
+
},
|
|
41
|
+
schema: [],
|
|
42
|
+
type: "problem",
|
|
43
|
+
},
|
|
44
|
+
name: "require-valid-skill-license",
|
|
45
|
+
});
|
|
46
|
+
export default requireValidSkillLicenseRule;
|
|
47
|
+
//# sourceMappingURL=require-valid-skill-license.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-skill-license.js","sourceRoot":"","sources":["../../src/rules/require-valid-skill-license.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EACH,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACtB,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,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;YAEhE,IACI,WAAW,KAAK,IAAI;gBACpB,CAAC,mBAAmB,CAAC,WAAW,EAAE,SAAS,CAAC,EAC9C,CAAC;gBACC,OAAO;YACX,CAAC;YAED,IAAI,oBAAoB,CAAC,WAAW,EAAE,SAAS,CAAC,KAAK,SAAS,EAAE,CAAC;gBAC7D,OAAO;YACX,CAAC;YAED,qBAAqB,CAAC,OAAO,EAAE;gBAC3B,SAAS,EAAE,qBAAqB;aACnC,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,CAAC,wBAAwB,EAAE,qBAAqB,CAAC;YACjE,WAAW,EACP,0FAA0F;YAC9F,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,oBAAoB,EAAE,KAAK;SAC9B;QACD,QAAQ,EAAE;YACN,mBAAmB,EACf,2EAA2E;SAClF;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":"require-valid-skill-name.d.ts","sourceRoot":"","sources":["../../src/rules/require-valid-skill-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAsB7E,QAAA,MAAM,yBAAyB,EAAE,iBA0D/B,CAAC;AAEH,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { getSkillName, isValidSkillIdentifier, } from "../_internal/copilot-customization-names.js";
|
|
2
|
+
import { isSkillFilePath } from "../_internal/copilot-file-kind.js";
|
|
3
|
+
/**
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
* ESLint rule implementation for `require-valid-skill-name`.
|
|
6
|
+
*/
|
|
7
|
+
import { createCopilotRule } from "../_internal/create-copilot-rule.js";
|
|
8
|
+
import { extractFrontmatter, getFrontmatterScalar, hasFrontmatterField, } from "../_internal/frontmatter.js";
|
|
9
|
+
import { createMarkdownDocumentListener, reportAtDocumentStart, } from "../_internal/markdown-rule.js";
|
|
10
|
+
const requireValidSkillNameRule = createCopilotRule({
|
|
11
|
+
create(context) {
|
|
12
|
+
return createMarkdownDocumentListener(() => {
|
|
13
|
+
if (!isSkillFilePath(context.filename)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
17
|
+
if (frontmatter === null ||
|
|
18
|
+
!hasFrontmatterField(frontmatter, "name")) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const skillName = getFrontmatterScalar(frontmatter, "name");
|
|
22
|
+
if (skillName !== undefined &&
|
|
23
|
+
isValidSkillIdentifier(getSkillName(context.filename, frontmatter))) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
reportAtDocumentStart(context, {
|
|
27
|
+
data: {
|
|
28
|
+
name: skillName ?? "(empty)",
|
|
29
|
+
},
|
|
30
|
+
messageId: "invalidSkillName",
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
defaultOptions: [],
|
|
35
|
+
meta: {
|
|
36
|
+
deprecated: false,
|
|
37
|
+
docs: {
|
|
38
|
+
copilotConfigs: [
|
|
39
|
+
"copilot.configs.recommended",
|
|
40
|
+
"copilot.configs.strict",
|
|
41
|
+
"copilot.configs.all",
|
|
42
|
+
],
|
|
43
|
+
description: "require Copilot skill `name` metadata to use the documented lowercase-hyphen identifier form.",
|
|
44
|
+
frozen: false,
|
|
45
|
+
recommended: true,
|
|
46
|
+
requiresTypeChecking: false,
|
|
47
|
+
},
|
|
48
|
+
messages: {
|
|
49
|
+
invalidSkillName: "Copilot skill `name` values must use lowercase letters, digits, and hyphens only (current value: `{{name}}`).",
|
|
50
|
+
},
|
|
51
|
+
schema: [],
|
|
52
|
+
type: "problem",
|
|
53
|
+
},
|
|
54
|
+
name: "require-valid-skill-name",
|
|
55
|
+
});
|
|
56
|
+
export default requireValidSkillNameRule;
|
|
57
|
+
//# sourceMappingURL=require-valid-skill-name.js.map
|