Skip to content

Commit f3eb0c4

Browse files
Merge pull request #278 from DiogoRibeiro7/codex/set-up-stylelint-and-ci-workflow
Add Stylelint CSS linting
2 parents d4d20c5 + d26d774 commit f3eb0c4

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

.github/workflows/jekyll.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ jobs:
3939
ruby-version: '3.3' # Not needed with a .ruby-version file
4040
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
4141
cache-version: 0 # Increment this number if you need to re-download cached gems
42+
- name: Setup Node
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: '20'
46+
- name: Install Node dependencies
47+
run: npm ci
48+
- name: Lint CSS
49+
run: npm run lint:css
4250
- name: Setup Pages
4351
id: pages
4452
uses: actions/configure-pages@v5

.stylelintrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "stylelint-config-standard"
3+
}
4+

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ npm run build:js # minify and add banner
3939
npm run watch:js # optional: automatically rebuild on changes
4040
```
4141

42+
## CSS linting
43+
44+
Lint all SCSS files with [Stylelint](https://stylelint.io/):
45+
46+
```bash
47+
npm run lint:css
48+
```
49+
4250
## Local development
4351

4452
Install Ruby gems specified in the `Gemfile` with:

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@
2424
"devDependencies": {
2525
"npm-run-all": "^4.1.5",
2626
"onchange": "^7.1.0",
27-
"uglify-js": "^3.13.6"
27+
"uglify-js": "^3.13.6",
28+
"stylelint": "^15.0.0",
29+
"stylelint-config-standard": "^34.0.0"
2830
},
2931
"scripts": {
3032
"uglify": "uglifyjs assets/js/vendor/jquery/jquery-3.6.0.js assets/js/plugins/jquery.fitvids.js assets/js/plugins/jquery.greedy-navigation.js assets/js/plugins/jquery.magnific-popup.js assets/js/plugins/jquery.ba-throttle-debounce.js assets/js/plugins/smooth-scroll.js assets/js/plugins/gumshoe.js assets/js/_main.js -c -m -o assets/js/main.min.js",
3133
"add-banner": "node banner.js",
3234
"watch:js": "onchange \"assets/js/**/*.js\" -e \"assets/js/main.min.js\" -- npm run build:js",
3335
"build:js": "npm run uglify && npm run add-banner",
36+
"lint:css": "stylelint 'assets/css/**/*.scss' '_sass/**/*.scss'",
3437
"test": "node test.js"
3538
}
3639
}

0 commit comments

Comments
 (0)