Skip to content
Permalink
Browse files
Silently pass in node 4
Since [ESLint 5 no longer support node 4](https://eslint.org/docs/user-guide/migrating-to-5.0.0#-nodejs-4-is-no-longer-supported), standard should silently pass in node 4.
  • Loading branch information
Gerhut committed Aug 30, 2018
1 parent e1560df commit 9ee4d0f24cdf6a39def467b88e8504c28be15cfd
Showing 1 changed file with 2 additions and 2 deletions.
@@ -1,7 +1,7 @@
#!/usr/bin/env node

if (process.version.match(/v(\d+)\./)[1] < 4) {
console.error('standard: Node v4 or greater is required. `standard` did not run.')
if (process.version.match(/v(\d+)\./)[1] < 6) {
console.error('standard: Node 6 or greater is required. `standard` did not run.')
} else {
var opts = require('../options')
require('standard-engine').cli(opts)

4 comments on commit 9ee4d0f

@jimmywarting
Copy link
Contributor

@jimmywarting jimmywarting commented on 9ee4d0f Aug 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case we can update this lib to most of what node v6 supports also?

classes, const, let etc

@feross
Copy link
Member

@feross feross commented on 9ee4d0f Aug 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that is correct. If you want to send a PR, happy to look at it.

@jimmywarting
Copy link
Contributor

@jimmywarting jimmywarting commented on 9ee4d0f Aug 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do something similar in index.js?

if (node_v >= 6) {
  var Linter = require('standard-engine').linter
  var opts = require('./options')
  module.exports = new Linter(opts)
} else {
  module.exports noop // console.warn
}

@feross
Copy link
Member

@feross feross commented on 9ee4d0f Aug 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't the user can do this themselves if it's important to them? The command line program is used by nearly everyone in CI where it's not easy to add scripting.

Please sign in to comment.