Skip to content

feat: Add Directive and DirectiveType#112

Merged
mdjermanovic merged 5 commits intomainfrom
directive
Aug 30, 2024
Merged

feat: Add Directive and DirectiveType#112
mdjermanovic merged 5 commits intomainfrom
directive

Conversation

@nzakas
Copy link
Copy Markdown
Member

@nzakas nzakas commented Aug 27, 2024

Prerequisites checklist

What is the purpose of this pull request?

Add Directive class to @eslint/plugin-kit. (Extracted from the core.)

What changes did you make? (Give an overview)

  • Added a Directive class to @eslint/plugin-kit to be used when implementing SourceCode#getDisableDirectives()
  • Added a DirectiveType type to @eslint/core
  • Changed Directive#node to be type unknown instead of object to force consumers to type cast the value before using it.
  • Added tests for Directive

Related Issues

Is there anything you'd like reviewers to focus on?

Copy link
Copy Markdown
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably also want to re-export Directive here:

export {
CallMethodStep,
VisitNodeStep,
TextSourceCodeBase,
} from "./source-code.js";

@nzakas
Copy link
Copy Markdown
Member Author

nzakas commented Aug 29, 2024

Oops, correct!

Comment thread packages/plugin-kit/README.md Outdated
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Comment thread packages/plugin-kit/README.md Outdated
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Copy link
Copy Markdown
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit e5bbcf1 into main Aug 30, 2024
@mdjermanovic mdjermanovic deleted the directive branch August 30, 2024 10:28
@github-actions github-actions Bot mentioned this pull request Aug 30, 2024
snitin315 pushed a commit that referenced this pull request Mar 29, 2026
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

2 participants