Skip to content

Commit 15d4ada

Browse files
committed
ci: setup lint job
1 parent 2e01979 commit 15d4ada

9 files changed

Lines changed: 78 additions & 33 deletions

File tree

.github/dependabot.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22
updates:
33
- package-ecosystem: bundler
4-
directory: "/"
4+
directory: '/'
55
schedule:
66
interval: weekly
77
open-pull-requests-limit: 10
@@ -11,14 +11,14 @@ updates:
1111
groups:
1212
ruby:
1313
patterns:
14-
- "*"
15-
- package-ecosystem: "npm"
16-
directory: "/"
14+
- '*'
15+
- package-ecosystem: 'npm'
16+
directory: '/'
1717
schedule:
1818
interval: weekly
1919
allow:
2020
- dependency-type: direct
2121
groups:
2222
npm:
2323
patterns:
24-
- "*"
24+
- '*'

.github/workflows/gh-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ jobs:
5151
publish_dir: ./_site
5252
publish_branch: master
5353
force_orphan: true
54-
user_name: "github-actions[bot]"
55-
user_email: "github-actions[bot]@users.noreply.github.com"
54+
user_name: 'github-actions[bot]'
55+
user_email: 'github-actions[bot]@users.noreply.github.com'

.github/workflows/lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
cache: 'yarn'
19+
20+
- name: Install dependencies
21+
run: yarn install --frozen-lockfile
22+
23+
- name: Run linters
24+
run: yarn lint

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_site
2+
node_modules
3+
yarn.lock

.prettierrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

.stylelintrc.json

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,8 @@
55
"stylelint-config-recess-order"
66
],
77
"rules": {
8-
"function-comma-space-after": "always",
98
"no-descending-specificity": null,
109
"declaration-block-single-line-max-declarations": 1,
11-
"unit-whitelist": [
12-
"%",
13-
"ch",
14-
"deg",
15-
"em",
16-
"fr",
17-
"ms",
18-
"px",
19-
"rem",
20-
"s",
21-
"turn",
22-
"vh",
23-
"vw"
24-
],
25-
"max-empty-lines": 1,
26-
"max-line-length": 110,
27-
"no-empty-first-line": true,
28-
"indentation": 2,
29-
"number-leading-zero": "always",
3010
"media-feature-name-no-unknown": [
3111
true,
3212
{

Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
default: setup clean fix serve
1+
default: setup clean lintfix serve
22

33
setup:
44
yarn check || yarn
55
bundle check || bundle
66
make update
77

8-
fix:
9-
prettier --write --no-semi "**/*.yml" "**/*.md" "**/*.scss" "assets/**/*.js"
10-
yarn run stylelint --fix "assets/**/*.scss" || echo 'stylelint: found no scss files to lint'
8+
lint:
9+
yarn lint
10+
make lint-ruby
11+
12+
lintfix:
13+
yarn lintfix
14+
make lintfix-ruby
15+
16+
lint-ruby:
17+
bundle exec rubocop
18+
19+
lintfix-ruby:
1120
bundle exec rubocop -a
1221

1322
clean:

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22
"license": "UNLICENSED",
33
"private": true,
44
"scripts": {
5-
"lintfix": "stylelint --fix assets/**/*.scss"
5+
"lint": "yarn lint:stylelint && yarn lint:prettier",
6+
"lint:stylelint": "stylelint assets/**/*.scss",
7+
"lint:prettier": "prettier --check .",
8+
"lintfix": "yarn lintfix:stylelint && yarn lintfix:prettier",
9+
"lintfix:stylelint": "stylelint --fix assets/**/*.scss",
10+
"lintfix:prettier": "prettier --write ."
611
},
712
"devDependencies": {
13+
"prettier": "3.3.3",
814
"stylelint": "16.22.0",
915
"stylelint-config-recess-order": "7.1.0",
16+
"stylelint-order": "6.0.4",
1017
"stylelint-config-recommended-scss": "15.0.1",
1118
"stylelint-scss": "6.12.1"
1219
},

yarn.lock

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,12 +613,17 @@ postcss-selector-parser@^7.1.0:
613613
cssesc "^3.0.0"
614614
util-deprecate "^1.0.2"
615615

616+
postcss-sorting@^8.0.2:
617+
version "8.0.2"
618+
resolved "https://registry.yarnpkg.com/postcss-sorting/-/postcss-sorting-8.0.2.tgz#6393385ece272baf74bee9820fb1b58098e4eeca"
619+
integrity sha512-M9dkSrmU00t/jK7rF6BZSZauA5MAaBW4i5EnJXspMwt4iqTh/L9j6fgMnbElEOfyRyfLfVbIHj/R52zHzAPe1Q==
620+
616621
postcss-value-parser@^4.2.0:
617622
version "4.2.0"
618623
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514"
619624
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
620625

621-
postcss@^8.5.6:
626+
postcss@^8.4.32, postcss@^8.5.6:
622627
version "8.5.6"
623628
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.6.tgz#2825006615a619b4f62a9e7426cc120b349a8f3c"
624629
integrity sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==
@@ -627,6 +632,11 @@ postcss@^8.5.6:
627632
picocolors "^1.1.1"
628633
source-map-js "^1.2.1"
629634

635+
prettier@3.3.3:
636+
version "3.3.3"
637+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105"
638+
integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==
639+
630640
punycode@^2.1.0:
631641
version "2.1.1"
632642
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
@@ -721,6 +731,14 @@ stylelint-config-recommended@^16.0.0:
721731
resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-16.0.0.tgz#0221f19902816fe7d53d9a01eb0be4cc7b4fe80a"
722732
integrity sha512-4RSmPjQegF34wNcK1e1O3Uz91HN8P1aFdFzio90wNK9mjgAI19u5vsU868cVZboKzCaa5XbpvtTzAAGQAxpcXA==
723733

734+
stylelint-order@6.0.4:
735+
version "6.0.4"
736+
resolved "https://registry.yarnpkg.com/stylelint-order/-/stylelint-order-6.0.4.tgz#3e80d876c61a98d2640de181433686f24284748b"
737+
integrity sha512-0UuKo4+s1hgQ/uAxlYU4h0o0HS4NiQDud0NAUNI0aa8FJdmYHA5ZZTFHiV5FpmE3071e9pZx5j0QpVJW5zOCUA==
738+
dependencies:
739+
postcss "^8.4.32"
740+
postcss-sorting "^8.0.2"
741+
724742
stylelint-scss@6.12.1, stylelint-scss@^6.12.0:
725743
version "6.12.1"
726744
resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-6.12.1.tgz#7de9980a7c9acb7a3f203498e7296526cb52ffa0"

0 commit comments

Comments
 (0)