From 265557ac7cfddd513c808f44de115a43d4234b3a Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Sat, 16 Nov 2019 08:08:38 -0800 Subject: [PATCH] Require Node.js 8 and ESLint 6 (#8) --- .travis.yml | 2 +- package.json | 13 ++++++------- test/test.js | 10 +++++----- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2ae9d62..f98fed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: + - '12' - '10' - '8' - - '6' diff --git a/package.json b/package.json index 228d621..c1cd288 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "url": "sindresorhus.com" }, "engines": { - "node": ">=6" + "node": ">=8" }, "scripts": { "test": "ava" @@ -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" } } diff --git a/test/test.js b/test/test.js index 5e54270..69604d4 100644 --- a/test/test.js +++ b/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; @@ -18,14 +18,14 @@ 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 => { @@ -33,6 +33,6 @@ test('esnext', t => { 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'); });