From 7439b48cf4356473e4f1596e47aac34c8345163a Mon Sep 17 00:00:00 2001 From: Thomas Broyer Date: Mon, 24 Jun 2019 23:30:12 +0200 Subject: [PATCH] Add explicit support for ESLint 6.0.0 (#15974) Preemptively update tests wrt 'parser' requiring an absolute path rather than a package name, even though the project is still using ESLint 4. Fixes #15971 --- .../__tests__/ESLintRuleExhaustiveDeps-test.js | 2 +- .../__tests__/ESLintRulesOfHooks-test.js | 2 +- packages/eslint-plugin-react-hooks/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js b/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js index e78e5104aa..8a72692335 100644 --- a/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js +++ b/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js @@ -12,7 +12,7 @@ const ReactHooksESLintPlugin = require('eslint-plugin-react-hooks'); const ReactHooksESLintRule = ReactHooksESLintPlugin.rules['exhaustive-deps']; ESLintTester.setDefaultConfig({ - parser: 'babel-eslint', + parser: require.resolve('babel-eslint'), parserOptions: { ecmaVersion: 6, sourceType: 'module', diff --git a/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js b/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js index 4a5623dcd4..466321c46b 100644 --- a/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js +++ b/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js @@ -12,7 +12,7 @@ const ReactHooksESLintPlugin = require('eslint-plugin-react-hooks'); const ReactHooksESLintRule = ReactHooksESLintPlugin.rules['rules-of-hooks']; ESLintTester.setDefaultConfig({ - parser: 'babel-eslint', + parser: require.resolve('babel-eslint'), parserOptions: { ecmaVersion: 6, sourceType: 'module', diff --git a/packages/eslint-plugin-react-hooks/package.json b/packages/eslint-plugin-react-hooks/package.json index 9adf1a1174..32827d8afb 100644 --- a/packages/eslint-plugin-react-hooks/package.json +++ b/packages/eslint-plugin-react-hooks/package.json @@ -29,6 +29,6 @@ }, "homepage": "https://reactjs.org/", "peerDependencies": { - "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0" + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" } }