From 29ce4f2b48661ef3326a472a625011aff8b8422f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Fri, 15 May 2020 10:10:49 +0200 Subject: [PATCH] chore: bump eslint config to latest (#308) * chore: bump eslint config to latest * lint fix * lint pass * use roles directly --- .eslintrc | 3 +- package.json | 2 +- src/__tests__/a11yAPI.test.js | 8 +- src/__tests__/debug.test.js | 2 +- src/__tests__/questionsBoard.test.js | 5 +- src/__tests__/render.test.js | 11 ++- src/__tests__/waitForElement.test.js | 2 +- src/cleanup.js | 2 +- src/flushMicrotasksQueue.js | 2 +- src/helpers/a11yAPI.js | 22 +++--- src/helpers/findByAPI.js | 2 +- src/helpers/getByAPI.js | 20 ++--- src/helpers/makeQuery.js | 8 +- src/render.js | 4 +- src/waitForElement.js | 2 +- yarn.lock | 110 ++++++++++++++++++++++----- 16 files changed, 139 insertions(+), 66 deletions(-) diff --git a/.eslintrc b/.eslintrc index dee43815..4e273da1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -9,6 +9,7 @@ "import/no-unresolved": [ 2, { "ignore": ["^@theme", "^@docusaurus", "^@generated"] } - ] + ], + "react-native-a11y/has-valid-accessibility-ignores-invert-colors": 0 } } diff --git a/package.json b/package.json index 36370962..a3a33b6d 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "devDependencies": { "@babel/cli": "^7.8.4", "@babel/core": "^7.9.0", - "@callstack/eslint-config": "^9.1.0", + "@callstack/eslint-config": "^10.0.0", "@release-it/conventional-changelog": "^1.1.0", "@types/react": "^16.9.34", "@types/react-native": "^0.62.2", diff --git a/src/__tests__/a11yAPI.test.js b/src/__tests__/a11yAPI.test.js index a5cebd7e..1524a0a3 100644 --- a/src/__tests__/a11yAPI.test.js +++ b/src/__tests__/a11yAPI.test.js @@ -5,10 +5,8 @@ import { render } from '..'; const BUTTON_LABEL = 'cool button'; const BUTTON_HINT = 'click this button'; -const BUTTON_ROLE = 'button'; const TEXT_LABEL = 'cool text'; const TEXT_HINT = 'static text'; -const TEXT_ROLE = 'link'; // Little hack to make all the methods happy with type const NO_MATCHES_TEXT: any = 'not-existent-element'; const NO_INSTANCES_FOUND = 'No instances found'; @@ -27,13 +25,13 @@ class Button extends React.Component { { } test('debug', () => { - jest.spyOn(console, 'log').mockImplementation(x => x); + jest.spyOn(console, 'log').mockImplementation((x) => x); const component =