Skip to content

Include components directory in stylesheet linting#9903

Merged
aduth merged 1 commit intomainfrom
aduth-lint-components-scss
Jan 11, 2024
Merged

Include components directory in stylesheet linting#9903
aduth merged 1 commit intomainfrom
aduth-lint-components-scss

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Jan 11, 2024

🛠 Summary of changes

Includes stylesheets located within the app/components directory for linting.

This matches build sources:

"build:css": "build-sass app/assets/stylesheets/*.css.scss app/components/*.scss --load-path=app/assets/stylesheets --out-dir=app/assets/builds"

See previous discussion: #9840 (comment)

📜 Testing Plan

Verify lint:css passes.

For bonus points, introduce a stylistic error to a .scss file within app/components and verify the same command fails.

Example:

diff --git a/app/components/captcha_submit_button_component.scss b/app/components/captcha_submit_button_component.scss
index 545f6b084..83a8d8851 100644
--- a/app/components/captcha_submit_button_component.scss
+++ b/app/components/captcha_submit_button_component.scss
@@ -2,2 +2,3 @@
   visibility: hidden;
+  
 }
$ yarn lint:css                       
yarn run v1.22.19
$ stylelint 'app/assets/stylesheets/**/*.scss' 'app/javascript/**/*.scss' 'app/components/*.scss'

app/components/captcha_submit_button_component.scss
 3:1  ✖  Delete "··⏎"  prettier/prettier

1 problem (1 error, 0 warnings)

error Command failed with exit code 2.

changelog: Internal, Automated Testing, Include components directory in stylesheet linting
@aduth aduth requested a review from nprimak January 11, 2024 13:07
@aduth aduth merged commit 36c1d90 into main Jan 11, 2024
@aduth aduth deleted the aduth-lint-components-scss branch January 11, 2024 13:30
@aduth aduth restored the aduth-lint-components-scss branch January 11, 2024 13:31
@aduth aduth deleted the aduth-lint-components-scss branch January 11, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants