The stylelint CI only checks /css directory and uses drupal core .prettierrc.json configuration instead of canvas.
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3569963. -->
Reported by: [vishalkhode](https://www.drupal.org/user/2439156)
Related to !512
>>>
<h3 id="overview">Overview</h3>
<p>While fixing issue <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3566392" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3566392</a></span>, we discovered that the <code>stylelint</code> CI job has two critical issues:</p>
<ol>
<li><strong>Limited scope: </strong>It only runs linting for CSS files in the root-level <code>/css</code> folder, completely missing CSS files in other directories like <code>/ui</code>.</li>
<li><strong>Configuration Update:</strong> The CI pipeline uses <code>.prettierrc.json</code> from Drupal core. Ensure it uses project's own configuration.</li>
</ol>
<h3 id="steps-to-reproduce">Steps to reproduce</h3>
<ul>
<li>Create an MR and make any css files and you'll see <code>styelint</code> CI job is triggerd.</li>
<li>Observe that it logs following:<br>
<pre>4 sources checked<br> /builds/issue/canvas/web/modules/custom/canvas/css/autocomplete.extend.css<br> /builds/issue/canvas/web/modules/custom/canvas/css/canvas-cta.css<br> /builds/issue/canvas/web/modules/custom/canvas/css/menu-icons.css<br> /builds/issue/canvas/web/modules/custom/canvas/css/navigation-override.css</pre></li>
<li>Note in above logs the CSS files in <code>/css</code> directory are only included and potentially other directories are not included. Ex: <code>/ui</code> directory.</li>
</ul>
<h3 id="steps-to-reproduce">Proposed resolution</h3>
<ul>
<li>Investigate why the stylelint CI job is limited to the root <code>/css</code> folder.</li>
<li>Update the stylelint CI configuration to:
<ul>
<li>Include CSS files from all directories (including css files from <code>/ui</code> directory).</li>
<li>Use Canvas project's <code>.prettierrc.json</code> configuration instead of Drupal core.</li>
</ul>
</li>
<li>Fix any linting errors discovered in the newly-scanned directories</li>
<li>Verify that the updated CI job successfully checks all CSS files across the project using the correct configuration.</li>
<li>Update documentation if needed.</li>
</ul>
issue