-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (45 loc) · 1.56 KB
/
Makefile
File metadata and controls
53 lines (45 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
ESLINT_TEST_OPTIONS = --parser-options '{"project":["tsconfig.json"]}'
all:
@echo 'Nothing to do'
help:
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@echo " all - Default target (does nothing)"
@echo " test - Runs the test suite"
@echo " clean - Removes build artifacts"
@echo " distclean - Removes all build artifacts and dependencies"
node_modules/.done: package.json package-lock.json
rm -rf node_modules
npm install
touch node_modules/.done
node_modules: node_modules/.done
@:
test: node_modules
npm run eslint package.json index.js
npm run eslint -- $(ESLINT_TEST_OPTIONS) tests/good
@retval='0' && for file in tests/bad/*.ts; do \
npm run eslint -- $(ESLINT_TEST_OPTIONS) "$$file" || continue; \
echo "File $$file should have failed, but did not -- this is a test failure"; \
retval='1'; \
done; \
exit "$$retval"
@retval='0' && for file in tests/bad/*.fix.ts; do \
rm -rf "tests/fix/" && \
mkdir -p "tests/fix/" && \
cp "$$file" "tests/fix/" && \
npm run eslint -- --fix $(ESLINT_TEST_OPTIONS) 'tests/fix' || :; \
npm run eslint -- $(ESLINT_TEST_OPTIONS) 'tests/fix' && continue; \
echo "File $$file should have been fixed, but still failed -- this is a test failure"; \
retval='1'; \
done; \
exit "$$retval"
rm -rf tests/fix
cd plugins/eslint-plugin-return-parens && npm run test
cd plugins/eslint-plugin-prefer-bigint-literal && npm run test
clean:
rm -rf node_modules plugins/eslint-plugin-return-parens/node_modules
rm -rf tests/fix
distclean: clean
@:
.PHONY: all help test clean distclean