Add lint commands
This commit is contained in:
parent
bc3a69ac8f
commit
1d18a42427
1 changed files with 20 additions and 1 deletions
21
Makefile
21
Makefile
|
@ -1,8 +1,12 @@
|
||||||
# A Makefile to run various tasks
|
# A Makefile to run various tasks
|
||||||
|
|
||||||
.PHONY: sass js compress
|
.PHONY: sass frontend js compress lint-sass lint-js lint-php
|
||||||
jsfiles := $(wildcard resources/assets/js/*.js)
|
jsfiles := $(wildcard resources/assets/js/*.js)
|
||||||
sassfiles := $(wildcard resources/assets/sass/*.scss)
|
sassfiles := $(wildcard resources/assets/sass/*.scss)
|
||||||
|
phpfiles := $(wildcard app/*.php) \
|
||||||
|
$(wildcard app/**/*.php) \
|
||||||
|
$(wildcard app/**/**/*.php) \
|
||||||
|
$(wildcard app/**/**/**/*.php)
|
||||||
yarnfiles:= node_modules/whatwg-fetch/fetch.js \
|
yarnfiles:= node_modules/whatwg-fetch/fetch.js \
|
||||||
node_modules/alertify.js/dist/js/alertify.js \
|
node_modules/alertify.js/dist/js/alertify.js \
|
||||||
node_modules/store2/dist/store2.min.js \
|
node_modules/store2/dist/store2.min.js \
|
||||||
|
@ -34,3 +38,18 @@ compress: $(assets)
|
||||||
zopfli $$f; \
|
zopfli $$f; \
|
||||||
bro --force --quality 11 --input $$f --output $$f.br; \
|
bro --force --quality 11 --input $$f --output $$f.br; \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
|
lint-sass: $(sassfiles)
|
||||||
|
for f in $^; do \
|
||||||
|
stylelint --syntax=scss $$f; \
|
||||||
|
done;
|
||||||
|
|
||||||
|
lint-js: $(jsfiles)
|
||||||
|
for f in $^; do \
|
||||||
|
eslint $$f; \
|
||||||
|
done;
|
||||||
|
|
||||||
|
lint-php: $(phpfiles)
|
||||||
|
for f in $^; do \
|
||||||
|
php -l $$f; \
|
||||||
|
done;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue