Skip to content

Commit

Permalink
Merge pull request #469 from dxw/stylelint
Browse files Browse the repository at this point in the history
Add CSS linting using stylelint
  • Loading branch information
Floppy authored Oct 26, 2022
2 parents 422a0ff + a63b4d7 commit 61d4356
Show file tree
Hide file tree
Showing 6 changed files with 1,015 additions and 2 deletions.
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
app/builds/assets
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["stylelint-config-standard-scss", "stylelint-config-prettier"]
}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ COPY .eslintignore ${APP_HOME}/.eslintignore
COPY .eslintrc.json ${APP_HOME}/.eslintrc.json
COPY .prettierignore ${APP_HOME}/.prettierignore
COPY .prettierrc ${APP_HOME}/.prettierrc
COPY .stylelintrc.json ${APP_HOME}/.stylelintrc.json
COPY .stylelintignore ${APP_HOME}/.stylelintignore

COPY .rspec ${APP_HOME}/.rspec
COPY spec ${APP_HOME}/spec
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "rails-template",
"private": true,
"scripts": {
"lint:css": "npx stylelint \"app/**/*css\"",
"lint:css:fix": "npx stylelint \"app/**/*css\" --fix",
"lint:format": "prettier --check '**/*'",
"lint:format:fix": "prettier --write '**/*'",
"lint:js": "eslint .",
Expand All @@ -11,6 +13,10 @@
"devDependencies": {
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"prettier": "^2.7.1"
"prettier": "^2.7.1",
"stylelint": "^14.12.1",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^28.0.0",
"stylelint-config-standard-scss": "^5.0.0"
}
}
9 changes: 9 additions & 0 deletions script/all/test
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ else
yarn run lint:js
fi

if [ -n "$AUTOMATICALLY_FIX_LINTING" ]; then
echo "==> Linting CSS in fix mode..."
yarn run lint:css:fix
else
echo "==> Linting CSS..."
yarn run lint:css
fi


echo "==> Running the tests..."
bundle exec rspec

Expand Down
Loading

0 comments on commit 61d4356

Please sign in to comment.