Skip to content
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

Functions as Object properties #15

Open
Tzahile opened this issue Nov 17, 2021 · 0 comments
Open

Functions as Object properties #15

Tzahile opened this issue Nov 17, 2021 · 0 comments

Comments

@Tzahile
Copy link

Tzahile commented Nov 17, 2021

Description

Create a .js file in an environment with eslint and eslint-plugin-prefer-arrow-functions
create an object with a function as a property:

const myObj = {
  dummyMethod(){
    // ...
  }
}

The plugin will mark (warn / error) the function.

In some cases, we'd like to use functions as object properties.
In my case, I use Vuejs 2, and each component has this error for the data property:

export default {
  data(){
    return {...}
  }
}

Suggested Solution

It could be great if there's an option to add a rule to the rule-section for prop functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant