Skip to content

Unexpected side effect in "computedName" computed property #427

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

Closed
artnikbrothers opened this issue Mar 11, 2018 · 1 comment
Closed

Unexpected side effect in "computedName" computed property #427

artnikbrothers opened this issue Mar 11, 2018 · 1 comment
Assignees
Labels

Comments

@artnikbrothers
Copy link

artnikbrothers commented Mar 11, 2018

Tell us about your environment

  • ESLint Version: 4.18.1
  • eslint-plugin-vue Version: 4.3.0
  • Node Version: v9.4.0

Please show your full configuration:

module.exports = {
  root: true,
  parserOptions: {
    parser: 'babel-eslint',
    ecmaVersion: 2017,
    sourceType: 'module'
  },
  env: {
    browser: true,
    node: true
  },
  extends: ['plugin:vue/recommended'],
  // required to lint *.vue files
  plugins: [
    'vue'
  ],
  // add your custom rules here
  rules: {
    // allow paren-less arrow functions
    'arrow-parens': 0,
    // allow async-await
    'generator-star-spacing': 'off',
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    // allow assignment in return statement
    'no-return-assign': 0,
    "vue/order-in-components": ["error", {
      order: [
        "el",
        "name",
        "parent",
        "functional",
        "mixins",
        ["delimiters", "comments"],
        ["components", "directives", "filters"],
        "extends",
        "inheritAttrs",
        "model",
        ["props", "propsData"],
        "data",
        "computed",
        "watch",
        "methods",
        "LIFECYCLE_HOOKS",
        ["template", "render"],
        "renderError"
      ]
    }]
  },
  globals: {
    // OT: false
  }
}

What did you do? Please include the actual source code causing the issue.

data () {
  return {
    someArray: [1, 2, 3]
  }
},
computed: {
  foo () {
    this.someArray.forEach(arr => console.log(arr)) // Unexpected side effect in "foo" computed property
  }
}

What actually happened? Please include the actual, raw output from ESLint.
Unexpected side effect in "foo" computed property

@michalsnik michalsnik added the bug label Mar 22, 2018
@michalsnik michalsnik self-assigned this Mar 22, 2018
@michalsnik
Copy link
Member

Addressed in #464. Closing in favor of #420

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

No branches or pull requests

2 participants