Skip to content

Commit

Permalink
Require Node.js 8 and ESLint 6 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper authored and sindresorhus committed Nov 16, 2019
1 parent c2bd832 commit 265557a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,5 +1,5 @@
language: node_js
node_js:
- '12'
- '10'
- '8'
- '6'
13 changes: 6 additions & 7 deletions package.json
Expand Up @@ -10,7 +10,7 @@
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
"node": ">=8"
},
"scripts": {
"test": "ava"
Expand Down Expand Up @@ -52,15 +52,14 @@
"simple"
],
"dependencies": {
"eslint-config-xo": "^0.26.0"
"eslint-config-xo": "^0.27.2"
},
"devDependencies": {
"ava": "^1.1.0",
"eslint": "^5.12.0",
"is-plain-obj": "^1.0.0",
"temp-write": "^3.1.0"
"ava": "^2.4.0",
"eslint": "^6.6.0",
"is-plain-obj": "^2.0.0"
},
"peerDependencies": {
"eslint": "^5.12.0"
"eslint": ">=6.6.0"
}
}
10 changes: 5 additions & 5 deletions test/test.js
@@ -1,14 +1,14 @@
import test from 'ava';
import isPlainObj from 'is-plain-obj';
import eslint from 'eslint';
import tempWrite from 'temp-write';
import path from 'path';

const fixture = `'use strict';\nconst x = true;\n\nif (x) {\n console.log();\n}\n`;

function runEslint(str, conf) {
const linter = new eslint.CLIEngine({
useEslintrc: false,
configFile: tempWrite.sync(JSON.stringify(conf))
configFile: path.join(__dirname, conf)
});

return linter.executeOnText(str).results[0].messages;
Expand All @@ -18,21 +18,21 @@ test('main', t => {
const conf = require('../');
t.true(isPlainObj(conf));
t.true(isPlainObj(conf.rules));
t.is(runEslint(fixture, conf).length, 0);
t.is(runEslint(fixture, '../index.js').length, 0);
});

test('browser', t => {
const conf = require('../browser');
t.true(isPlainObj(conf));
t.true(isPlainObj(conf.rules));
t.is(runEslint(fixture, conf).length, 0);
t.is(runEslint(fixture, '../browser.js').length, 0);
});

test('esnext', t => {
const conf = require('../esnext');
t.true(isPlainObj(conf));
t.true(isPlainObj(conf.rules));

const errors = runEslint('class Foo {}\n', conf);
const errors = runEslint('class Foo {}\n', '../esnext.js');
t.is(errors[0].ruleId, 'no-unused-vars');
});

0 comments on commit 265557a

Please sign in to comment.