File: rules

package info (click to toggle)
node-mysticatea-eslint-plugin 12.0.0~ds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 704 kB
  • sloc: javascript: 3,003; makefile: 72; perl: 48; sh: 1
file content (93 lines) | stat: -rwxr-xr-x 3,401 bytes parent folder | download | duplicates (2)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/make -f

# generate documentation unless nodoc requested
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
DOCS = README.html README.txt
endif

NODE_ENV = NO_COLOR=1 NODE_PATH=debian/node_modules
NODE = $(NODE_ENV) node
ESLINT = $(NODE_ENV) eslint
MOCHA = $(NODE_ENV) mocha --no-timeout
MOCHA_TAP := $(MOCHA) --reporter tap
# normalize output with TAP where possible unless terse requested
ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
ESLINT += --format tap
MOCHA += --reporter tap
else
ESLINT += --format unix
MOCHA += --reporter dot --no-colors
endif

# Work around ESLint seemingly not supporting NODE_PATH
ESLINT_EXCLUDES += \
 tests/lib/configs/_rules.js

# Work around missing node modules
MOCHA_EXCLUDES += \
 tests/lib/configs/ts.js \
 tests/lib/configs/vue.js

# Work around misc. breakage
MOCHA_ISOLATE += \
 tests/lib/configs/es5.js \
 tests/lib/configs/eslint-plugin.js \
 tests/lib/configs/node.js

override_dh_auto_clean:
	rm -rf debian/node_modules

override_dh_clean:
	dh_clean -- $(DOCS)

override_dh_auto_configure:
	mkdir -p debian/node_modules/@mysticatea
	ln --force --symbolic ../../.. debian/node_modules/@mysticatea/eslint-plugin

override_dh_auto_build: $(DOCS)
	$(NODE) scripts/generate-browser-globals
	$(NODE) scripts/generate-configs
	$(NODE) scripts/generate-rules
ifeq (,$(filter pkg.eslint.stage1,$(DEB_BUILD_PROFILES)))
	$(ESLINT) --fix lib/configs/_browser-globals.js lib/configs.js lib/rules.js
endif

# TODO: fix remaining test failures
override_dh_auto_test:
ifeq (,$(filter pkg.eslint.stage1,$(DEB_BUILD_PROFILES)))
	$(ESLINT) $(patsubst %,--ignore-pattern %,$(ESLINT_EXCLUDES)) \
		lib scripts tests
endif
	$(MOCHA) $(patsubst %,--exclude %,$(MOCHA_EXCLUDES) $(MOCHA_ISOLATE)) \
		"tests/lib/**/*.js"
	$(MOCHA_TAP) $(patsubst %,--exclude %,$(MOCHA_EXCLUDES)) \
		$(MOCHA_ISOLATE) \
		| debian/tap-todo \
		"'es5.js' should include existing rule 'multiline-comment-style'." \
		"'es5.js' should include existing rule 'no-misleading-character-class'." \
		"'\+eslint-plugin.js' should include existing rule '\@mysticatea/eslint-plugin/prefer-object-rule'." \
		"'\+eslint-plugin.js' should include existing rule '\@mysticatea/eslint-plugin/require-meta-docs-description'." \
		"'\+eslint-plugin.js' should include existing rule '\@mysticatea/eslint-plugin/require-meta-schema'." \
		"'\+node.js' should include existing rule '\@mysticatea/node/callback-return'." \
		"'\+node.js' should include existing rule '\@mysticatea/node/global-require'." \
		"'\+node.js' should include existing rule '\@mysticatea/node/handle-callback-err'." \
		"'\+node.js' should include existing rule '\@mysticatea/node/no-mixed-requires'." \
		"'\+node.js' should include existing rule '\@mysticatea/node/no-new-require'." \
		"'\+node.js' should include existing rule '\@mysticatea/node/no-path-concat'." \
		"'\+node.js' should include existing rule '\@mysticatea/node/no-process-env'." \
		"'\+node.js' should include existing rule '\@mysticatea/node/no-process-exit'." \
		"'\+node.js' should include existing rule '\@mysticatea/node/no-restricted-import'." \
		"'\+node.js' should include existing rule '\@mysticatea/node/no-restricted-require'." \
		"'\+node.js' should include existing rule '\@mysticatea/node/no-sync'."

override_dh_installdocs:
	dh_installdocs --all -- $(DOCS)

%.html: %.md
	cmark-gfm $< > $@

%.txt: %.md
	cmark-gfm --to plaintext $< > $@

%:
	dh $@