Skip to content
This repository was archived by the owner on Jan 6, 2020. It is now read-only.

Commit f77bbe8

Browse files
committed
Avoid running XO on older Node.js versions
1 parent 0f850a2 commit f77bbe8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"node": ">=0.10.0"
1414
},
1515
"scripts": {
16-
"test": "xo && ava",
16+
"test": "node xo.js && ava",
1717
"preversion": "WRITE_EXAMPLES=1 npm run test && git add example-output.md"
1818
},
1919
"files": [

xo.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env node
2+
/* eslint-disable import/no-unassigned-import */
3+
'use strict';
4+
5+
var major = Number(process.version.match(/^v(\d+)/)[1]);
6+
if (major >= 4) {
7+
require('xo/cli');
8+
} else {
9+
console.warn('Linting requires Node.js >=4');
10+
}

0 commit comments

Comments
 (0)