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

Change Request: Add support for config comments #21

Closed
1 task
nzakas opened this issue Aug 27, 2024 · 4 comments · Fixed by #27
Closed
1 task

Change Request: Add support for config comments #21

nzakas opened this issue Aug 27, 2024 · 4 comments · Fixed by #27
Assignees
Labels
accepted enhancement New feature or request

Comments

@nzakas
Copy link
Member

nzakas commented Aug 27, 2024

Environment

ESLint version: HEAD
@eslint/json version: HEAD
Node version:
npm version:
Operating System:

What problem do you want to solve?

The JSON plugin currently does not support configuration comments.

What do you think is the correct solution?

Implement configuration comments using the ConfigCommentParser utility. These would only apply in JSONC and JSON5, but we should support all of these:

/* eslint rule: off */
/* eslint-disable rule */
/* eslint-enable rule */
/* eslint-disable-line rule */
/* eslint-disable-next-line rule */

The logic should be similar to the JS logic

Participation

  • I am willing to submit a pull request for this change.

Additional comments

Looking for a volunteer to implement this.

@nzakas nzakas added the enhancement New feature or request label Aug 27, 2024
@mdjermanovic
Copy link
Member

I'd like to work on this.

@mdjermanovic
Copy link
Member

Working on this now.

@mdjermanovic
Copy link
Member

/* eslint rule: off */

Just off or any rule configuration comments? E.g., /* eslint json/no-duplicate-keys: "error" */

@nzakas
Copy link
Member Author

nzakas commented Sep 25, 2024

Any rule configuration comments. I was just too lazy to provide more examples. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants