From 3493b060ec5efddc8a06733b5dbfe9f33cbce63e Mon Sep 17 00:00:00 2001 From: Julian Grinblat Date: Mon, 16 Sep 2019 19:37:29 +0900 Subject: [PATCH] [eslint config] [minor] Support eslint-plugin-react-hooks@2 --- .travis.yml | 11 +++++++++++ packages/eslint-config-airbnb/package.json | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index df4ad7cf56..b43ee559d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ install: - 'if [ -n "${PACKAGE-}" ]; then cd "packages/${PACKAGE}"; fi' - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' - 'if [ -n "${ESLINT}" ]; then npm install --no-save "eslint@${ESLINT}"; fi' + - 'if [ -n "${REACT_HOOKS}" ]; then npm install --no-save "eslint-plugin-react-hooks@${REACT_HOOKS}"; fi' script: - 'if [ -n "${PREPUBLISH-}" ]; then npm run pretravis && npm run prepublish && npm run posttravis; elif [ -n "${LINT-}" ]; then npm run lint; else npm run travis; fi' sudo: false @@ -18,8 +19,10 @@ env: matrix: - 'TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb-base' - 'TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb' + - 'TEST=true ESLINT=6 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb' - 'TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb-base' - 'TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb' + - 'TEST=true ESLINT=5 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb' matrix: fast_finish: true include: @@ -27,20 +30,28 @@ matrix: env: PREPUBLISH=true ESLINT=6 PACKAGE=eslint-config-airbnb-base - node_js: "lts/*" env: PREPUBLISH=true ESLINT=6 PACKAGE=eslint-config-airbnb + - node_js: "lts/*" + env: PREPUBLISH=true ESLINT=6 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb - node_js: "lts/*" env: PREPUBLISH=true ESLINT=5 PACKAGE=eslint-config-airbnb-base - node_js: "lts/*" env: PREPUBLISH=true ESLINT=5 PACKAGE=eslint-config-airbnb + - node_js: "lts/*" + env: PREPUBLISH=true ESLINT=5 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb - node_js: "lts/*" env: LINT=true - node_js: "7" env: TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb-base - node_js: "7" env: TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb + - node_js: "7" + env: TEST=true ESLINT=5 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb - node_js: "6" env: TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb-base - node_js: "6" env: TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb + - node_js: "6" + env: TEST=true ESLINT=5 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb exclude: allow_failures: - node_js: "11" diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json index c58f98a902..74a699a34c 100644 --- a/packages/eslint-config-airbnb/package.json +++ b/packages/eslint-config-airbnb/package.json @@ -68,7 +68,7 @@ "eslint-plugin-import": "^2.20.1", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-react": "^7.18.3", - "eslint-plugin-react-hooks": "^1.7.0", + "eslint-plugin-react-hooks": "^2.0.0 || ^1.7.0", "in-publish": "^2.0.0", "react": ">= 0.13.0", "safe-publish-latest": "^1.1.4", @@ -79,7 +79,7 @@ "eslint-plugin-import": "^2.20.1", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-react": "^7.18.3", - "eslint-plugin-react-hooks": "^1.7.0" + "eslint-plugin-react-hooks": "^2.0.0 || ^1.7.0" }, "engines": { "node": ">= 6"