title: ESLint warning (should use method for non-callbacks) - How to treat that?
body: <p>How can I solve this warning from ESLint?</p>
  
  <p>I have an event listener for resize inside componentDidMount:</p>
  
  <pre><code>componentDidMount() {
     window.addEventListener('resize', this.resizeEditor);
  }
  
  componentWillUnmount() {
     window.removeEventListener('resize', this.resizeEditor);
  }
  </code></pre>
  
  <p>And my method to update on Resize:</p>
  
  <pre><code>resizeEditor = () =&gt; {
     if (this.editor) this.editor.layout();
  }
  </code></pre>
  
  <p>It's working like this, but I'm getting a warning: </p>
  
  <blockquote>
    <p>[eslint] should use method for non-callbacks [class-prefer-methods/prefer-methods]</p>
  </blockquote>
  
  <p>If I change the arrow function to:</p>
  
  <pre><code>resizeEditor() {
     if (this.editor) this.editor.layout();
  }
  </code></pre>
  
  <p>Of course It won't find <strong>this.editor</strong>. It's out of the scope.</p>
  
  <p>If I try to pass the editor to my resize function:</p>
  
  <pre><code> window.addEventListener('resize', () =&gt; this.resizeEditor(this.editor));
  
   resizeEditor(editor) {
     if (editor) editor.layout();
   }
  </code></pre>
  
  <p>I'm getting another warning:</p>
  
  <blockquote>
    <p>[eslint] Expected 'this' to be used by class method 'resizeEditor'. [class-methods-use-this]</p>
  </blockquote>
  
  <p>So, I'm kind blocked here what path follow to not get these warnings.</p>
  
  <p>Thanks!</p>