Skip to content

Dictionary allow only string as key lint #4543

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

Merged
merged 5 commits into from
Jun 13, 2025
Merged

Dictionary allow only string as key lint #4543

merged 5 commits into from
Jun 13, 2025

Conversation

l-trotta
Copy link
Contributor

@l-trotta l-trotta commented Jun 12, 2025

Adds linter rule for dictionary + fix rule-breaking type.
TaskId is currently a string | integer union, but I can find no evidence of it being a number anywhere.
sources:

the format is actually nodeId:taskId which is a string.
Closes #4510

@l-trotta l-trotta added the skip-backport This pull request should not be backported label Jun 12, 2025
@l-trotta
Copy link
Contributor Author

@flobernd @Anaethelion this is not breaking for java since string | integer unions are simplified to string, checking just in case it is breaking for your clients

Copy link
Member

@flobernd flobernd left a comment

Choose a reason for hiding this comment

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

LGTM!

import invalidNodeTypes from './rules/invalid-node-types.js'

export default {
rules: {
'single-key-dictionary-key-is-string': singleKeyDict,
'dictionary-key-is-string': Dict,
Copy link
Member

Choose a reason for hiding this comment

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

Nit: code style.

@l-trotta l-trotta merged commit 15e1dfb into main Jun 13, 2025
8 checks passed
@l-trotta l-trotta deleted the dict-string-lint branch June 13, 2025 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-backport This pull request should not be backported specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[validation] Dictionary key type should resolve to string
3 participants