Add rule only if variable is in a class #22
-
Hello, I'm looking to allow variable to have this format "_{camelCase}", only if they're nested in a class. How can I write a rule that will only allow it in class but not in arrowFunctions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @arome, Currently, this option is not available unless your class files have a prefix in the file name or your classes are located in a folder with a specific name. Which specific case are you interested in? If it’s case1, I can implement it relatively easily in the next version by introducing a new class Car {
_model: string; // case1
constructor(model: string) {
this._model = model;
}
doSomething = (): string => {
const _someVariable = ""; // case2
return `${_someVariable} ${this._model}`;
}
} |
Beta Was this translation helpful? Give feedback.
@arome
v3.9.0 Now you can define case1 using the new selector
propertyDefinition
.