-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow functions with certain names #9
Comments
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, eslint-plugin-prefer-arrow-functions/src/prefer-arrow-functions.ts Lines 203 to 214 in 4520ba6
There is a `getFunctionName function eslint-plugin-prefer-arrow-functions/src/prefer-arrow-functions.ts Lines 80 to 81 in 4520ba6
Adding a new option of names to ignore gets read here eslint-plugin-prefer-arrow-functions/src/prefer-arrow-functions.ts Lines 35 to 43 in 4520ba6
And the new value will also want adding the ESLint's schema eslint-plugin-prefer-arrow-functions/src/prefer-arrow-functions.ts Lines 17 to 32 in 4520ba6
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
The text was updated successfully, but these errors were encountered: