eslint-plugin-functional: [functional-parameters] ignore pattern option not working with object expressions
Bug Report
I am trying to use the functional-parameters rule in a Nuxt.Js 2 project.
As you may know, Vue.Js (on which Nuxt.Js is based) provides functions for its lifecycle like mounted()
.
Expected behavior
These functions will have no parameters in most cases, so I have to ignore them.
Actual behavior
Unfortunately, despite many attempts, I was unable to ignore them.
Steps to reproduce
Here is the last configuration I tried for the rule:
{
"rules": {
"functional/functional-parameters": [
"error",
{
"ignorePattern": [
"^mounted$",
"^created$",
"^unmount$",
"^unmounted$",
"^beforeDestroy$",
"^destroy$",
"^updated$",
"^beforeUpdate$",
"^onBeforeUpdate$",
"^onUpdated$",
"^onMounted$"
]
}
]
}
}
Proposed changes
- [ ] Fix
ignorePattern
property for this rule - Propose some ignorance models according to frameworks in the documentation
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20
Ah, if you’re not using typescript then you can’t use the
ignoreVoid
option. That option requires type information in order to identify what functions are void returning functions. You’ll need to manually specify the names of all the functions when just using JavaScript.