Skip to content

Commit

Permalink
Merge pull request #25 from jonataswalker/change-to-eslint
Browse files Browse the repository at this point in the history
Change to Eslint
  • Loading branch information
jonataswalker committed Apr 1, 2016
2 parents f13541c + e5e3cf2 commit c1a1cd3
Show file tree
Hide file tree
Showing 11 changed files with 1,783 additions and 1,786 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: node_js

node_js:
- "4"

script: "make ci"

branches:
only:
- master
35 changes: 20 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,28 @@ CSS_COMBINED := $(BUILD_DIR)/ol3-geocoder.css
CSS_FINAL := $(BUILD_DIR)/ol3-geocoder.min.css
TMPFILE := $(BUILD_DIR)/tmp
PACKAGE_JSON := $(ROOT_DIR)/package.json
LAST_VERSION := $(shell cat $(PACKAGE_JSON) | node -pe "JSON.parse(require('fs').readFileSync('/dev/stdin').toString()).version")
LAST_VERSION := $(shell node -p "require('./package.json').version")

JS_FILES := $(SRC_DIR)/wrapper-head.js \
$(SRC_DIR)/utils.js \
$(SRC_DIR)/base.js \
$(SRC_DIR)/nominatim.js \
$(SRC_DIR)/utils.js \
$(SRC_DIR)/wrapper-tail.js

CSS_FILES := $(SRC_DIR)/ol3-geocoder.css

CLEANCSS := ./node_modules/.bin/cleancss
NODE_MODULES := ./node_modules/.bin
CLEANCSS := $(NODE_MODULES)/cleancss
CLEANCSSFLAGS := --skip-restructuring
POSTCSS := ./node_modules/.bin/postcss
POSTCSS := $(NODE_MODULES)/postcss
POSTCSSFLAGS := --use autoprefixer -b "last 2 versions"
JSHINT := ./node_modules/.bin/jshint
UGLIFYJS := ./node_modules/.bin/uglifyjs
UGLIFYJSFLAGS := --mangle --mangle-regex --screw-ie8 --lint -c warnings=true
JS_BEAUTIFY := ./node_modules/.bin/js-beautify
ESLINT := $(NODE_MODULES)/eslint
UGLIFYJS := $(NODE_MODULES)/uglifyjs
UGLIFYJSFLAGS := --mangle --mangle-regex --screw-ie8 -c warnings=false
JS_BEAUTIFY := $(NODE_MODULES)/js-beautify
BEAUTIFYFLAGS := -f - --indent-size 2 --preserve-newlines
NODEMON := ./node_modules/.bin/nodemon
PARALLELSHELL := ./node_modules/.bin/parallelshell
NODEMON := $(NODE_MODULES)/nodemon
PARALLELSHELL := $(NODE_MODULES)/parallelshell

# just to create variables like NODEMON_JS_FLAGS when called
define NodemonFlags
Expand All @@ -46,24 +47,28 @@ endef
export HEADER

# targets

.PHONY: ci
ci: build

build-watch: build watch

watch:
$(PARALLELSHELL) "make watch-js" "make watch-css"

build: build-js build-css

build-js: combine-js jshint uglifyjs addheader
@echo "Build JS ... OK"
build-js: combine-js lint uglifyjs addheader
@echo `date +'%H:%M:%S'` " - build JS ... OK"

build-css: combine-css cleancss
@echo "Build CSS ... OK"
@echo `date +'%H:%M:%S'` " - build CSS ... OK"

uglifyjs: $(JS_DEBUG)
@$(UGLIFYJS) $^ $(UGLIFYJSFLAGS) > $(JS_FINAL)

jshint: $(JS_DEBUG)
@$(JSHINT) $^
lint: $(JS_DEBUG)
@$(ESLINT) $^

addheader-debug: $(JS_DEBUG)
@echo "$$HEADER" | cat - $^ > $(TMPFILE) && mv $(TMPFILE) $^
Expand Down
4 changes: 0 additions & 4 deletions build/.jshintrc

This file was deleted.

Loading

0 comments on commit c1a1cd3

Please sign in to comment.