-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
enhancement: plugin rule optionNew rule option for an existing eslint-plugin ruleNew rule option for an existing eslint-plugin rulepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Repro
Hey ho 👋, this is a feature request. What do you think of allowing multiple leading or trailing underscores? There are some libraries that use double underscore (__
) to avoid name clashes. Probably the most popular one is GraphQL where you can specify a __typename
(see here).
Personally, I want to use camelCase or PascalCase and I'm ok with people pre- or postfixing names with underscores. We could introduce a 4th value for the leadingUnderscore
and trailingUnderscore
option that is called allowMultiple
, like this:
{
"rules": {
"@typescript-eslint/naming-convention": ["warn", {
"format": ["camelCase", "PascalCase", "UPPER_CASE"],
"leadingUnderscore": "allowMultiple",
"selector": "default",
"trailingUnderscore": "allowMultiple"
}]
}
}
AlansCodeLog, MattCrouch, sapegin, felixfbecker, andrewvitaler and 4 more
Metadata
Metadata
Assignees
Labels
enhancement: plugin rule optionNew rule option for an existing eslint-plugin ruleNew rule option for an existing eslint-plugin rulepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin