Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

Commit

Permalink
style: add stylelint and lefthook
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmcodes committed Sep 19, 2020
1 parent d3426e9 commit 368c911
Show file tree
Hide file tree
Showing 4 changed files with 943 additions and 24 deletions.
44 changes: 44 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# EXAMPLE USAGE
# Refer for explanation to following link:
# https://github.com/Arkweid/lefthook/blob/master/docs/full_guide.md
#
# pre-push:
# commands:
# packages-audit:
# tags: frontend security
# run: yarn audit
# gems-audit:
# tags: backend security
# run: bundle audit
#
# pre-commit:
# parallel: true
# commands:
# eslint:
# glob: "*.{js,ts}"
# run: yarn eslint {staged_files}
# rubocop:
# tags: backend style
# glob: "*.rb"
# exclude: "application.rb|routes.rb"
# run: bundle exec rubocop --force-exclusion {all_files}
# govet:
# tags: backend style
# files: git ls-files -m
# glob: "*.go"
# run: go vet {files}
# scripts:
# "hello.js":
# runner: node
# "any.go":
# runner: go run

pre-commit:
parallel: true
commands:
js:
glob: "*.js"
run: "yarn prettier --write {staged_files} && yarn eslint {staged_files} && git add {staged_files}"
css:
glob: "*.{css,pcss}"
run: "yarn prettier --write {staged_files} && yarn stylelint --fix {staged_files} && git add {staged_files}"
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"version": "0.1.0",
"devDependencies": {
"@arkweid/lefthook": "^0.7.2",
"babel-eslint": "^10.1.0",
"eslint": "^7.9.0",
"eslint-config-airbnb-base": "^14.2.0",
Expand All @@ -18,6 +19,10 @@
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-prettier": "^3.1.4",
"prettier": "^2.1.2",
"stylelint": "^13.7.1",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^20.0.0",
"stylelint-prettier": "^1.1.2",
"webpack-dev-server": "^3.11.0"
}
}
3 changes: 3 additions & 0 deletions stylelint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["stylelint-config-standard", "stylelint-prettier/recommended"],
};
Loading

0 comments on commit 368c911

Please sign in to comment.