Skip to content

Unexpected side effect in "computedName" computed property #427

Closed
@artnikbrothers

Description

@artnikbrothers

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions