Closed
Conversation
mdjermanovic
requested changes
Oct 13, 2024
Member
mdjermanovic
left a comment
There was a problem hiding this comment.
| @@ -0,0 +1,61 @@ | |||
| /** | |||
| * @fileoverview Tests for no-empty-keys rule. | |||
Member
There was a problem hiding this comment.
Suggested change
| * @fileoverview Tests for no-empty-keys rule. | |
| * @fileoverview Tests for no-unnormalized-keys rule. |
Comment on lines
+18
to
+25
| schema: { | ||
| type: "array", | ||
| minItems: 0, | ||
| maxItems: 1, | ||
| items: { | ||
| enum: ["NFC", "NFD", "NFKC", "NFKD"], | ||
| }, | ||
| }, |
Member
There was a problem hiding this comment.
Suggested change
| schema: { | |
| type: "array", | |
| minItems: 0, | |
| maxItems: 1, | |
| items: { | |
| enum: ["NFC", "NFD", "NFKC", "NFKD"], | |
| }, | |
| }, | |
| schema: [ | |
| { | |
| enum: ["NFC", "NFD", "NFKC", "NFKD"], | |
| }, | |
| ], |
This can be simplified by using the shorthand form (https://eslint.org/docs/latest/extend/custom-rules#options-schemas, the first format).
Comment on lines
+34
to
+37
| const key = | ||
| node.name.type === "String" | ||
| ? node.name.value | ||
| : node.name.name; |
Member
There was a problem hiding this comment.
Can you add an invalid test where node.name is an Identifier node?
Member
|
@bmeck there's feedback for you here. |
Member
|
@bmeck are you still working on this? |
Member
|
I'm going to finish this up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites checklist
What is the purpose of this pull request?
To add a rule to check for JSON keys that are not normalized.
What changes did you make? (Give an overview)
Added a rule to check for JSON keys that are not normalized.
Related Issues
Fixes #32
Is there anything you'd like reviewers to focus on?
Couldn't get options working on invalid test cases?