From 698b04366dad8a1bf8d165dc9282593191d32496 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 19 Aug 2019 23:39:02 +0200 Subject: [PATCH] Upgrade to ESLint 6 Fixes #390 --- config/plugins.js | 2 +- package.json | 50 +++++++++++++++-------------- test/fixtures/gitignore/test/bar.js | 2 +- test/fixtures/overrides/test/bar.js | 2 +- test/fixtures/overrides/test/foo.js | 2 +- test/open-report.js | 2 +- test/options-manager.js | 2 +- 7 files changed, 32 insertions(+), 30 deletions(-) diff --git a/config/plugins.js b/config/plugins.js index 159d7366..f325937d 100644 --- a/config/plugins.js +++ b/config/plugins.js @@ -3,7 +3,7 @@ module.exports = { // Repeated here from eslint-config-xo in case some plugins set something different parserOptions: { - ecmaVersion: 2019, + ecmaVersion: 2020, sourceType: 'module', ecmaFeatures: { jsx: true diff --git a/package.json b/package.json index b73519ed..c5df4aa1 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "node": ">=6" }, "scripts": { - "test": "node cli-main.js && eslint . && nyc ava" + "test": "node cli-main.js && eslint --quiet . && nyc ava" }, "files": [ "config", @@ -48,13 +48,13 @@ "simple" ], "dependencies": { - "arrify": "^1.0.1", + "arrify": "^2.0.1", "debug": "^4.1.0", - "eslint": "^5.15.0", - "eslint-config-prettier": "^3.3.0", + "eslint": "^6.2.0", + "eslint-config-prettier": "^6.1.0", "eslint-config-xo": "^0.26.0", "eslint-formatter-pretty": "^2.0.0", - "eslint-plugin-ava": "^5.1.0", + "eslint-plugin-ava": "^8.0.0", "eslint-plugin-eslint-comments": "^3.0.1", "eslint-plugin-import": "^2.14.0", "eslint-plugin-no-use-extend-native": "^0.4.0", @@ -62,40 +62,42 @@ "eslint-plugin-prettier": "^3.0.0", "eslint-plugin-promise": "^4.0.0", "eslint-plugin-unicorn": "^7.0.0", - "find-cache-dir": "^2.0.0", - "get-stdin": "^6.0.0", + "find-cache-dir": "^3.0.0", + "get-stdin": "^7.0.0", "globby": "^9.0.0", - "has-flag": "^3.0.0", + "has-flag": "^4.0.0", "lodash.isequal": "^4.5.0", - "lodash.mergewith": "^4.6.1", + "lodash.mergewith": "^4.6.2", "meow": "^5.0.0", - "multimatch": "^3.0.0", - "open-editor": "^1.2.0", - "path-exists": "^3.0.0", - "pkg-conf": "^2.1.0", + "multimatch": "^4.0.0", + "open-editor": "^2.0.1", + "path-exists": "^4.0.0", + "pkg-conf": "^3.1.0", "prettier": "^1.15.2", - "resolve-cwd": "^2.0.0", - "resolve-from": "^4.0.0", - "semver": "^5.5.0", - "slash": "^2.0.0", - "update-notifier": "^2.3.0", + "resolve-cwd": "^3.0.0", + "resolve-from": "^5.0.0", + "semver": "^6.3.0", + "slash": "^3.0.0", + "update-notifier": "^3.0.1", "xo-init": "^0.7.0" }, "devDependencies": { "ava": "^1.1.0", - "coveralls": "^3.0.0", - "eslint-config-xo-react": "^0.17.0", - "eslint-plugin-react": "^7.6.1", + "coveralls": "^3.0.6", + "eslint-config-xo-react": "^0.20.0", + "eslint-plugin-react": "^7.14.3", + "eslint-plugin-react-hooks": "^1.7.0", "execa": "^1.0.0", - "nyc": "^13.0.1", + "nyc": "^14.1.1", "pify": "^4.0.0", - "proxyquire": "^2.0.1", - "temp-write": "^3.4.0" + "proxyquire": "^2.1.3", + "temp-write": "^4.0.0" }, "eslintConfig": { "extends": "eslint-config-xo" }, "eslintIgnore": [ + "cli.js", "test/fixtures" ] } diff --git a/test/fixtures/gitignore/test/bar.js b/test/fixtures/gitignore/test/bar.js index 475628a5..85f458aa 100644 --- a/test/fixtures/gitignore/test/bar.js +++ b/test/fixtures/gitignore/test/bar.js @@ -1,6 +1,6 @@ import test from 'ava' import fn from '..' -test(t => { +test('main', t => { t.is(fn('foo'), fn('foobar')) }) diff --git a/test/fixtures/overrides/test/bar.js b/test/fixtures/overrides/test/bar.js index 475628a5..85f458aa 100644 --- a/test/fixtures/overrides/test/bar.js +++ b/test/fixtures/overrides/test/bar.js @@ -1,6 +1,6 @@ import test from 'ava' import fn from '..' -test(t => { +test('main', t => { t.is(fn('foo'), fn('foobar')) }) diff --git a/test/fixtures/overrides/test/foo.js b/test/fixtures/overrides/test/foo.js index 1dfeb6ca..c3a4f108 100644 --- a/test/fixtures/overrides/test/foo.js +++ b/test/fixtures/overrides/test/foo.js @@ -1,6 +1,6 @@ import test from 'ava' import fn from '..' -test(t => { +test('main', t => { t.is(fn('foo'), fn('foobar')) }) diff --git a/test/open-report.js b/test/open-report.js index 6d547a79..fc2cf398 100644 --- a/test/open-report.js +++ b/test/open-report.js @@ -1,5 +1,5 @@ -import test from 'ava'; import path from 'path'; +import test from 'ava'; import proxyquire from 'proxyquire'; import fn from '..'; diff --git a/test/options-manager.js b/test/options-manager.js index 9f8f512d..a0fd9c2f 100644 --- a/test/options-manager.js +++ b/test/options-manager.js @@ -43,7 +43,7 @@ test('normalizeOptions: falsie values stay falsie', t => { test('buildConfig: defaults', t => { const config = manager.buildConfig({}); - t.true(/[\\/]\.cache\/xo[\\/]?$/u.test(slash(config.cacheLocation))); + t.regex(slash(config.cacheLocation), /[\\/]\.cache\/xo[\\/]?$/u); t.is(config.useEslintrc, false); t.is(config.cache, true); t.is(config.baseConfig.extends[0], 'xo/esnext');