Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Directive and DirectiveType #112

Merged
merged 5 commits into from
Aug 30, 2024
Merged

feat: Add Directive and DirectiveType #112

merged 5 commits into from
Aug 30, 2024

Conversation

nzakas
Copy link
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
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
Member Author

nzakas commented Aug 29, 2024

Oops, correct!

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Copy link
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
14 checks passed
@mdjermanovic mdjermanovic deleted the directive branch August 30, 2024 10:28
@github-actions github-actions bot mentioned this pull request Aug 30, 2024
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