Eslint on contrib is making incorrect recommendations
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3432261. --> Reported by: [alexpott](https://www.drupal.org/user/157725) Related to !161 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>It's basically impossible to make js that passes the eslint rules as implemented and adhere to coding standards and not break stuff.</p> <p>Example: <a href="https://git.drupalcode.org/project/content_lock/-/jobs/1106563">https://git.drupalcode.org/project/content_lock/-/jobs/1106563</a></p> <p>Core's eslint rules are confusing configured and on core js we run the and different ruleset and in a different way that contrib does. Core runs core/.eslintrc.passing.json whereas contrib gitlab uses core/.eslintrc.json. This means contrib misses out on core/.eslintrc.jquery.json and it gets warnings like</p> <pre>warning&nbsp; Unexpected unnamed function</pre><p> for stuff like</p> <pre>(function ($, Drupal, once) {</pre><p> which is exactly how core js looks.</p> <p>Not sure what to do here but the current state of play is not great. If you copy a core js file to contrib project it is going to fail.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Review approach to eslint and maybe run with core-js-passing.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3>
issue