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

erroneous: Disallow duplicate keys in object literals detection #2287

Closed
yphoenix opened this issue Feb 3, 2024 · 0 comments · Fixed by #2291
Closed

erroneous: Disallow duplicate keys in object literals detection #2287

yphoenix opened this issue Feb 3, 2024 · 0 comments · Fixed by #2291
Assignees

Comments

@yphoenix
Copy link

yphoenix commented Feb 3, 2024

Given the following JS (which is a cut down version of the real thing for simplicity)

const COMPONENT_INFO = {
	UIDivInput: {
		title: 'Atoms/UIDivInput'
	},
	UIDivSearch: {
		title: 'Atoms/UIDivSearch'
	},
	UIDivSelect: {
		title: 'Atoms/UIDivSelect/UIDivSelect'
	},
	UIFloatStaffForm: {
		title: 'Forms/Schedule Forms/UIFloatStaffForm'
	}
}

Generates the following erroneous issue as there is no duplicated key.

  ⚠ eslint(no-dupe-keys): Disallow duplicate keys in object literals
    ╭─[content/tests/UITests/js/index.js:49:5]
 48 │     },
 49 │     UIDivSearch: {
    ·     ───────────
 50 │         title: 'Atoms/UIDivSearch'
 51 │     },
 52 │     UIDivSelect: {
    ·     ───────────
 53 │         title: 'Atoms/UIDivSelect/UIDivSelect'
    ╰────
  help: Consider removing the duplicated key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants