8000 Nested prop mutation is not flagged · Issue #1828 · vuejs/eslint-plugin-vue · GitHub
[go: up one dir, main page]

Skip to content

Nested prop mutation is not flagged #1828

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
2 tasks done
sstern6 opened this issue Mar 24, 2022 · 2 comments
Closed
2 tasks done

Nested prop mutation is not flagged #1828

sstern6 opened this issue Mar 24, 2022 · 2 comments

Comments

@sstern6
Copy link
sstern6 commented Mar 24, 2022

Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 8.11.x
  • eslint-plugin-vue version: 8.5.x
  • Node version: 17.5.0
  • Operating System: OSX

Please show your full configuration:

const path = require('path');

module.exports = {
  root: true,
  env: {
    browser: true,
    node: true,
    jest: true,
  },
  extends: [
    'plugin:vue/essential',
    'plugin:vue/recommended',
    'plugin:vue-a11y/base',
    'airbnb-base',
  ],
};

What did you do?

export default {
  props: {
    thing: {
      type: Object,
      required: true,
    },
   mounted() {
      this.thing.nested = true;
   }
}

What did you expect to happen?
Error

What actually happened?
No error

Repository to reproduce this issue

@ota-meshi
Copy link
Member

Duplicate of #1314

@ota-meshi ota-meshi marked this as a duplicate of #1314 Mar 24, 2022
@sstern6
Copy link
Author
sstern6 commented Mar 24, 2022

@ota-meshi thanks for pointing this out.

Curious on why nested prop mutation would be allowed but regular prop mutation isnt.

It would catch the same issue and i personally think it should be guarded against.

WDYT?

Is there a way to introduce a strict flag you can toggle?

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

2 participants
0