Open michaeljota opened 3 years ago
For now I disable this config in component files:
{
files: ["*.component.ts"],
rules: {
// Factories (including lifecycles) should be named functions
"extra-rules/potential-point-free": "warn",
"prefer-arrow/prefer-arrow-functions": [
"error",
{
...preferArrowFunctionsConfig,
"singleReturnOnly": true,
},
],
},
},
Hi @michaeljota @Samuel-Beslogic,
This should be possible by modifying isSafeTransformation
to return false if the name matches one of the ones you want to ignore:
There is a `getFunctionName function
Adding a new option of names to ignore gets read here
And the new value will also want adding the ESLint's schema
Thanks a lot.
Description
In Angular, factories should be named functions, as you can read here angular/angular#13702 and here angular/angular#13614. Because of that, this rule interferes and throws when a factory is needed to be used.
Suggested Solution
Adding an option that allows us to add patterns to ignore would be helpful because then we would only need to come up with a standard name for factories in the project.
Help Needed