title: Vue.js & airbnb no-param-reassign lint rule - How to modify properties in array of objects?
body: <p>I'm using vue-cli &amp; accepted the ESLint default rules including <code>no-param-reassign</code> which I've never used before.</p>
  
  <p>I have a method that needs to:</p>
  
  <ol>
  <li><p>accept an array of <code>columnDefinition</code> objects</p></li>
  <li><p>Iterate through the objects and assign each one a <code>columnDefinition.originalOrder</code> number</p></li>
  <li><p>Reorder &amp; return the array.</p></li>
  </ol>
  
  <p><code>no-param-reassign</code> keeps erroring unless I use lodash to create a new array of new objects and return that.</p>
  
  <p>So for example, I pass in</p>
  
  <pre><code>                [
                      {
                          label: 'Number of Siblings',
                          searchEnabled: false,
                          sortEnabled: false,
                          newOrder: 3,
                          lotsOfNestedData: {
                              moreNesting: 'etc',
                          },
                      },
                      {
                          label: 'Pet Name',
                          searchEnabled: false,
                          sortEnabled: false,
                          newOrder: 1,
                          lotsOfNestedData: {
                              moreNesting: 'etc',
                          },
                      },
                      {
                          label: 'Favorite Hobby',
                          searchEnabled: false,
                          sortEnabled: false,
                          newOrder: 4,
                          lotsOfNestedData: {
                              moreNesting: 'etc',
                          },
                      },
                      {
                          label: 'Favorite Outfit',
                          searchEnabled: false,
                          sortEnabled: false,
                          newOrder: 2,
                          lotsOfNestedData: {
                              moreNesting: 'etc',
                          },
                      },
                  ]
  </code></pre>
  
  <p>Without this rule, I would <code>.each</code> through the array and mutate objects with a <code>item.originalOrder = idx</code> property. Then mutate the array with <code>.sort</code> based on <code>newOrder</code>.</p>
  
  <p>With the no mutating params rule, the best I can think of is to create a new array (so that I can sort it) and then create clones of each object which I can then add the <code>.originalOrder</code> property to. </p>
  
  <pre><code>const newSrcArray = _.map(srcArray, (item, idx) =&gt; {
      const newItem = _.cloneDeep(item);
      newItem.originalOrder = idx;
      return newItem;
  });
  
  //sort newSrcArray
  
  return newSrcArray;
  </code></pre>
  
  <p>This looks like extra code and memory, but am I missing something entirely?</p>
  
  <p>Is this boilerplate/memory the preferred way to do this?</p>
  
  <p>Or is the best practice just to turn the rule off?</p>