Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a3f7471

Browse filesBrowse files
danbevrvagg
authored andcommitted
build,test: guard eslint with crypto check
Currently, configuring --without-ssl will cause the lint-js target to fail with the following error: $ make lint-js Running JS linter... internal/util.js:101 throw new ERR_NO_CRYPTO(); ^ Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support at assertCrypto (internal/util.js:101:11) at crypto.js:31:1 ... (/node/tools/node_modules/eslint/node_modules/file-entry-cache/ cache.js:2:14) at Module._compile (internal/modules/cjs/loader.js:746:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:757:10) make: *** [lint-js] Error 1 There are also a number of tests that are affected in a similar way. This commit adds crypto checks to allow for lint-js and the affected tests to be skipped when configured --without-ssl. PR-URL: #26182 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 28758b8 commit a3f7471
Copy full SHA for a3f7471
Expand file treeCollapse file tree

18 files changed

+40
-2
lines changed
Open diff view settings
Collapse file

‎Makefile‎

Copy file name to clipboardExpand all lines: Makefile
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,8 +1184,12 @@ lint-js-fix:
11841184
# Note that on the CI `lint-js-ci` is run instead.
11851185
# Lints the JavaScript code with eslint.
11861186
lint-js:
1187-
@echo "Running JS linter..."
1188-
@$(call available-node,$(run-lint-js))
1187+
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
1188+
echo "Skipping $@ (no crypto)"; \
1189+
else \
1190+
echo "Running JS linter..."; \
1191+
$(call available-node,$(run-lint-js)) \
1192+
fi
11891193

11901194
jslint: lint-js
11911195
@echo "Please use lint-js instead of jslint"
Collapse file

‎test/parallel/test-eslint-alphabetize-errors.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-eslint-alphabetize-errors.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto)
5+
common.skip('missing crypto');
46
common.skipIfEslintMissing();
57

68
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
Collapse file

‎test/parallel/test-eslint-crypto-check.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-eslint-crypto-check.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto)
5+
common.skip('missing crypto');
46

57
common.skipIfEslintMissing();
68

Collapse file

‎test/parallel/test-eslint-documented-errors.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-eslint-documented-errors.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto)
5+
common.skip('missing crypto');
46
common.skipIfEslintMissing();
57

68
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
Collapse file

‎test/parallel/test-eslint-duplicate-requires.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-eslint-duplicate-requires.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto)
5+
common.skip('missing crypto');
46

57
common.skipIfEslintMissing();
68

Collapse file

‎test/parallel/test-eslint-eslint-check.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-eslint-eslint-check.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto)
5+
common.skip('missing crypto');
46

57
common.skipIfEslintMissing();
68

Collapse file

‎test/parallel/test-eslint-inspector-check.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-eslint-inspector-check.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto)
5+
common.skip('missing crypto');
46
common.skipIfEslintMissing();
57

68
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
Collapse file

‎test/parallel/test-eslint-lowercase-name-for-primitive.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-eslint-lowercase-name-for-primitive.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto)
5+
common.skip('missing crypto');
46

57
common.skipIfEslintMissing();
68

Collapse file

‎test/parallel/test-eslint-no-let-in-for-declaration.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-eslint-no-let-in-for-declaration.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto)
5+
common.skip('missing crypto');
46

57
common.skipIfEslintMissing();
68

Collapse file

‎test/parallel/test-eslint-no-unescaped-regexp-dot.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-eslint-no-unescaped-regexp-dot.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto)
5+
common.skip('missing crypto');
46

57
common.skipIfEslintMissing();
68

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.