Skip to content

AirBnb ESLint config, no-param-reassign warning in vuex mutation #3954

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
MaximBazarov opened this issue May 7, 2019 · 3 comments · Fixed by #3961
Closed

AirBnb ESLint config, no-param-reassign warning in vuex mutation #3954

MaximBazarov opened this issue May 7, 2019 · 3 comments · Fixed by #3961

Comments

@MaximBazarov
Copy link

Version

3.7.0

Reproduction link

https://github.com/MaximBazarov/vuex-eslint-mutation-warning

Environment info


  System:
    OS: macOS Mojave 10.14.4
    CPU: (8) x64 Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
  Binaries:
    Node: 10.15.3 - /usr/local/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 74.0.3729.131
    Firefox: Not Found
    Safari: 12.1
  npmPackages:
    @kazupon/vue-i18n-loader: ^0.3.0 => 0.3.0 
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.3 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.3 
    @vue/babel-preset-app:  3.7.0 
    @vue/babel-preset-jsx:  1.0.0-beta.3 
    @vue/babel-sugar-functional-vue:  1.0.0-beta.3 
    @vue/babel-sugar-inject-h:  1.0.0-beta.3 
    @vue/babel-sugar-v-model:  1.0.0-beta.3 
    @vue/babel-sugar-v-on:  1.0.0-beta.3 
    @vue/cli-overlay:  3.7.0 
    @vue/cli-plugin-babel: ^3.7.0 => 3.7.0 
    @vue/cli-plugin-eslint: ^3.7.0 => 3.7.0 
    @vue/cli-plugin-unit-jest: ^3.7.0 => 3.7.0 
    @vue/cli-service: ^3.7.0 => 3.7.0 
    @vue/cli-shared-utils:  3.7.0 
    @vue/component-compiler-utils:  2.6.0 
    @vue/eslint-config-airbnb: ^4.0.0 => 4.0.0 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^5.0.0 => 5.2.2 
    jest-serializer-vue:  2.0.2 
    vue: ^2.6.10 => 2.6.10 
    vue-cli-plugin-i18n: ^0.6.0 => 0.6.0 
    vue-eslint-parser:  2.0.3 
    vue-hot-reload-api:  2.3.3 
    vue-i18n: ^8.11.2 => 8.11.2 
    vue-i18n-extract:  0.4.14 
    vue-i18n-ts:  0.1.0 
    vue-jest:  3.0.4 
    vue-loader:  15.7.0 
    vue-router: ^3.0.3 => 3.0.6 
    vue-select: ^3.0.2 => 3.0.2 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.5.21 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
    vuex: ^3.0.1 => 3.1.0 
  npmGlobalPackages:
    @vue/cli: Not Found


Steps to reproduce

Vuex store mutation:

state = {...}

What is expected?

no ESLint warnings

What is actually happening?

ESLint no-param-reassign warning


it was fixed in
https://github.com/vuejs-templates/webpack/pull/1003/files#diff-8e97c989db32864ed48507016adcb32d

but seems that it wasn't applied.

@MaximBazarov
Copy link
Author

@MaximBazarov
Copy link
Author

btw, here's workaround I used:
in package,json -> eslintConfig -> rules

"no-param-reassign": [
	"error",
	{
	  "props": true,
	  "ignorePropertyModificationsFor": [
	    "state"
	  ]
	}
]

@lloydjatkinson
Copy link

Also seeing this problem. Thanks for the fix @MaximBazarov.

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

Successfully merging a pull request may close this issue.

4 participants