UNPKG

904 BPlain TextView Raw
1BIN=bin/jslint.js
2SOURCES=$(shell find bin lib -name '*.js' ! -name 'jslint*.js' -print)
3
4install:
5 npm i .
6
7# omit 'test' because running all tests is side-effect of asking for coverage
8prepublish: lint doc no-dos-endings check-coverage
9
10lint: $(SOURCES)
11 node ./bin/jslint.js --terse $(SOURCES); echo
12
13test:
14 ./node_modules/.bin/mocha -u tdd
15
16doc: man/jslint.1 doc/jslint.html
17
18man/jslint.1: doc/jslint.md
19 mkdir -p man
20 ./node_modules/.bin/ronn -r $< > $@
21
22doc/jslint.html: doc/jslint.md
23 ./node_modules/.bin/ronn -5 $< > $@
24
25no-dos-endings:
26 file $(SOURCES) | grep -v CRLF >/dev/null
27
28cover: $(SOURCES)
29 ./node_modules/.bin/istanbul cover -x "lib/jslint-*.js" --print=both ./node_modules/mocha/bin/_mocha -- -u tdd
30
31check-coverage: cover
32 ./node_modules/.bin/istanbul check-coverage --statements 90 --branches 90 --functions 90 --lines 90
33
34.PHONY: install lint test doc no-dos-endings check-coverage