test node 8 in travis
This commit is contained in:
parent
0239cceeda
commit
8fbfcfddc1
18
.eslintrc
Normal file
18
.eslintrc
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"env": { "shared-node-browser":true },
|
||||
"globals": {},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 3,
|
||||
},
|
||||
"plugins": [ "html", "json" ],
|
||||
"!extends": "eslint:recommended",
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"no-bitwise": 0,
|
||||
"curly": 0,
|
||||
"comma-style": [ 2, "last" ],
|
||||
"no-trailing-spaces": 2,
|
||||
"semi": [ 2, "always" ],
|
||||
"comma-dangle": [ 2, "never" ]
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "8"
|
||||
- "7"
|
||||
- "6"
|
||||
- "5"
|
||||
|
15
Makefile
15
Makefile
@ -9,20 +9,22 @@ ULIB=$(shell echo $(LIB) | tr a-z A-Z)
|
||||
DEPS=$(sort $(wildcard bits/*.js))
|
||||
TARGET=$(LIB).js
|
||||
FLOWTARGET=$(LIB).flow.js
|
||||
FLOWTGTS=$(TARGET) $(AUXTARGETS)
|
||||
CLOSURE=/usr/local/lib/node_modules/google-closure-compiler/compiler.jar
|
||||
|
||||
## Main Targets
|
||||
|
||||
.PHONY: all
|
||||
all: $(TARGET) $(AUXTARGETS) ## Build library and auxiliary scripts
|
||||
|
||||
$(TARGET) $(AUXTARGETS): %.js : %.flow.js
|
||||
$(FLOWTGTS): %.js : %.flow.js
|
||||
node -e 'process.stdout.write(require("fs").readFileSync("$<","utf8").replace(/^[ \t]*\/\*[:#][^*]*\*\/\s*(\n)?/gm,"").replace(/\/\*[:#][^*]*\*\//gm,""))' > $@
|
||||
|
||||
$(FLOWTARGET): $(DEPS)
|
||||
cat $^ | tr -d '\15\32' > $@
|
||||
|
||||
bits/01_version.js: package.json
|
||||
echo "ADLER32.version = '"`grep version package.json | awk '{gsub(/[^0-9a-z\.-]/,"",$$2); print $$2}'`"';" > $@
|
||||
echo "$(ULIB).version = '"`grep version package.json | awk '{gsub(/[^0-9a-z\.-]/,"",$$2); print $$2}'`"';" > $@
|
||||
|
||||
.PHONY: clean
|
||||
clean: clean-baseline ## Remove targets and build artifacts
|
||||
@ -56,12 +58,19 @@ clean-baseline: ## Remove test baselines
|
||||
## Code Checking
|
||||
|
||||
.PHONY: lint
|
||||
lint: $(TARGET) $(AUXTARGETS) ## Run jshint and jscs checks
|
||||
lint: $(TARGET) $(AUXTARGETS) ## Run eslint checks
|
||||
@eslint --ext .js,.njs,.json,.html,.htm $(TARGET) $(AUXTARGETS) $(CMDS) $(HTMLLINT) package.json bower.json
|
||||
if [ -e $(CLOSURE) ]; then java -jar $(CLOSURE) $(REQS) $(FLOWTARGET) --jscomp_warning=reportUnknownTypes >/dev/null; fi
|
||||
|
||||
.PHONY: old-lint
|
||||
old-lint: $(TARGET) $(AUXTARGETS) ## Run jshint and jscs checks
|
||||
@jshint --show-non-errors $(TARGET) $(AUXTARGETS)
|
||||
@jshint --show-non-errors $(CMDS)
|
||||
@jshint --show-non-errors package.json
|
||||
@jshint --show-non-errors --extract=always $(HTMLLINT)
|
||||
@jscs $(TARGET) $(AUXTARGETS)
|
||||
if [ -e $(CLOSURE) ]; then java -jar $(CLOSURE) $(REQS) $(FLOWTARGET) --jscomp_warning=reportUnknownTypes >/dev/null; fi
|
||||
|
||||
|
||||
.PHONY: flow
|
||||
flow: lint ## Run flow checker
|
||||
|
@ -3,7 +3,8 @@
|
||||
/*:: declare var ADLER32: ADLER32Module; */
|
||||
var X = ADLER32;
|
||||
|
||||
function console_log() { if(typeof console !== 'undefined') console.log.apply(console, [].slice.call(arguments)); }
|
||||
// $FlowIgnore
|
||||
function console_log(/*:: ...args:Array<any> */) { if(typeof console !== 'undefined') console.log.apply(console, [].slice.call(arguments)); }
|
||||
|
||||
function lpad(s/*:string*/, len/*:number*/, chr/*:?string*/)/*:string*/{
|
||||
var L/*:number*/ = len - s.length, C/*:string*/ = chr || " ";
|
||||
|
@ -2,6 +2,7 @@
|
||||
/*global ADLER32, console */
|
||||
var X = ADLER32;
|
||||
|
||||
// $FlowIgnore
|
||||
function console_log() { if(typeof console !== 'undefined') console.log.apply(console, [].slice.call(arguments)); }
|
||||
|
||||
function lpad(s, len, chr){
|
||||
|
Loading…
Reference in New Issue
Block a user