[Meta] Pass Eslint validations

Created on 27 January 2024, 5 months ago
Updated 13 April 2024, 2 months ago

Problem/Motivation

At πŸ“Œ Set up to date the gitlab-ci.yml configuration RTBC we did the necessary changes to have running Gitlab CI on the Examples module.
In there, we noticed that Examples is not passing the Eslint checks and we have several errors on the final report.
We'd need to fix them to have the project meeting the default eslint checks.
Initial report with all the issues detected can be found at: https://git.drupalcode.org/issue/examples-3417410/-/jobs/699835

The final goal is to have all the Eslint checks in green for every single sub-module on the Examples project and being one step closer to have a base pipeline with everything in green.

Proposed resolution

For every child issue on this meta:

  1. Follow the instructions from "How to run eslint locally for the examples module" to have Eslint running locally and being able to simulate the errors we got from Gitlab but locally.
  2. Run Eslint against the target sub-module
  3. Fix the issues found and make a MR with the fixes.

How to run Eslint locally for the examples module

At https://www.drupal.org/docs/develop/standards/javascript-coding-standard... β†’ it explains how to run Eslint for our custom modules. However these instructions seem to differ in terms of configuration if we compare them with how it is run by default by Gitlab CI.

Following you have the detailed instructions to replicate the steps done by Gitlab CI and get the same errors if any.

  1. Go to the location where you have the examples module locally, in this case: cd [FULL-PATH-TO-EXAMPLES-MODULE]
  2. Create a symlink with core/.prettierrc.json : ln -s [FULL-PATH-TO-DRUPAL]/core/.prettierrc.json .
  3. Init a .prettierignore with just '*.yml': echo '*.yml' > .prettierignore
  4. Run eslint in the same way Gitlab CI does: [FULL-PATH-TO-DRUPAL]/core/node_modules/.bin/eslint --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=[FULL-PATH-TO-DRUPAL]/core --ext=.js,.yml [PATH-AGAINST-RUN-ESLINT]

Remaining tasks

πŸ“Œ Task
Status

Active

Version

4.0

Component

Other

Created by

πŸ‡ͺπŸ‡ΈSpain jlbellido

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024