- Issue created by @ptmkenny
- last update
10 months ago 1 pass - last update
10 months ago 1 pass - 🇯🇵Japan ptmkenny
Since eslint flags some issues related to drupalci.yml, I removed it and added Drupal 9 testing to the GitLab CI config instead.
- last update
10 months ago 1 pass - Status changed to Needs work
10 months ago 3:36pm 9 May 2024 - 🇯🇵Japan ptmkenny
The MR fixes many of the identified issues.
The following remain:
***************************************************************************************************************************** Now running ESLINT using the --fix option. Any errors shown below are not fixable automatically. ***************************************************************************************************************************** $ $CI_PROJECT_DIR/$_WEB_ROOT/core/node_modules/.bin/eslint --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=$CI_PROJECT_DIR/$_WEB_ROOT/core --ext=.js,.yml $_ESLINT_EXTRA --fix . || EXIT_CODE_FIX=$? /builds/issue/rrssb-3446297/web/modules/custom/rrssb-3446297/rrssb.demo.js 1:1 error Expected an assignment or function call and instead saw an expression no-unused-expressions 1:24 error Shadowing of global property 'undefined' no-shadow-restricted-names 2:3 error $.ready is not allowed jquery/no-ready 3:5 error Prefer dispatchEvent + form.submit() to $.submit jquery/no-submit 9:34 error Prefer matches to $.is jquery/no-is 11:34 error Prefer value to $.val jquery/no-val 16:7 error Prefer getComputedStyle to $.css jquery/no-css 17:7 error Prefer getComputedStyle to $.css jquery/no-css 18:7 error 'rrssbConfigAll' is not defined no-undef /builds/issue/rrssb-3446297/web/modules/custom/rrssb-3446297/rrssb.init.js 9:7 error for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array no-restricted-syntax 9:7 error The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype guard-for-in /builds/issue/rrssb-3446297/web/modules/custom/rrssb-3446297/rrssb.nodetype.js 9:19 error Prefer textContent to $.text jquery/no-text ✖ 12 problems (12 errors, 0 warnings)
These are mostly from eslint-plugin-no-jquery. I rarely work with jQuery, so I'm setting to "Needs work" and hopefully someone experienced in jQuery can fix them.