Skip to content
This repository was archived by the owner on Apr 27, 2021. It is now read-only.
This repository was archived by the owner on Apr 27, 2021. It is now read-only.

no-duplicate-string ignore Key-Names #852

Description

@marvinside

I want to request a feature.

I have all the HTTP Status Codes in an Enum. This maces it easier to reference them and also immediately see what this code means.
The Enum Looks like this:

enum HTTPStatusCode {
	/// <ommited>

	'Bad Request' = 400,
	Unauthorized = 401,
	'Payment Required' = 402,
	Forbidden = 403,
	'Not Found' = 404,
	'Method Not Allowed' = 405,
	'Not Acceptable' = 406,
	/// <ommited>
}

As you see, there are spaces in the Keys.
So if i reference them, it looks like this: HTTPStatusCode['Bad Request']
If i use the same Code to often, i'll get the no-duplicate-string warning

Suggested rule-extension:

"no-duplicate-string": true, // Keep current behaivor
"no-duplicate-string": [true, "ignore-keynames"], // Ignore strings which are keynames

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions