Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed as not planned
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Edit: The description below referred to themember-naming
rule, which has since been replaced by the newnaming-convention
rule. This issue is still relevant.
Repro
{"rules": {"@typescript-eslint/member-naming": ["error", {"private":"^(?!_)" }] }}
classExample{private_var1;// Not a backing field, shouldn't start with an underscore.private_var2;// Allowed, as it's a backing field for the `var2` property.publicgetvar2(){returnthis._var2;}}
Expected Result
Error for_var1
, but not for_var2
(because it's a backing field).
Actual Result
Error for both fields.
Additional Info
SimilarTSLint issue with 33 👍.
Since this rule is different to the one in TSLint, the implementation would be different. Maybe anignoreBackingFields: boolean
option, or a way to set the naming for backing fields separately.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin | 1.13.0 |
@typescript-eslint/parser | 1.13.0 |
TypeScript | 3.4.5 |
ESLint | 6.1.0 |
node | 10.16.0 |
npm | 6.9.0 |
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin