From 4601cf87835384c293d6315bd6294cf0166205e8 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Wed, 31 Oct 2018 09:58:07 -0400 Subject: [PATCH 1/6] disabling eslint for Canvas because we are adding in jsx-a11y rules to eslint. --- .../public/components/autocomplete/autocomplete.js | 9 +++++++++ .../components/element_content/invalid_element_type.js | 4 ++++ .../components/element_content/invalid_expression.js | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js index a57f367407d89..97eff5644683b 100644 --- a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js +++ b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js @@ -4,6 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ +/*disabling eslint because of these jsx-a11y errors: +181:7 error Elements with the 'combobox' interactive role must be focusable jsx-a11y/interactive-supports-focus + 187:9 error Elements with the ARIA role "combobox" must have the following attributes defined: aria-controls,aria-expanded jsx-a11y/role-has-required-aria-props + 209:23 error Elements with the 'option' interactive role must be focusable jsx-a11y/interactive-supports-focus + 218:25 error Elements with the ARIA role "option" must have the following attributes defined: aria-selected jsx-a11y/role-has-required-aria-props +*/ +/* eslint-disable */ + + import React from 'react'; import PropTypes from 'prop-types'; import { EuiFlexGroup, EuiFlexItem, EuiPanel, keyCodes } from '@elastic/eui'; diff --git a/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js b/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js index 08d8a5294e9a4..945d31328638c 100644 --- a/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js +++ b/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js @@ -3,6 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +/* Disabling eslint because of this jsx-a11y error: +11:3 error Non-interactive elements should not be assigned mouse or keyboard event listeners jsx-a11y/no-noninteractive-element-interactions +*/ +/* eslint-disable */ import React from 'react'; import PropTypes from 'prop-types'; diff --git a/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js b/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js index 0c17f9ac51732..907c9cae83e88 100644 --- a/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js +++ b/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js @@ -4,6 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ +/* Disabling eslint because of this jsx-a11y error: + 11:3 error Non-interactive elements should not be assigned mouse or keyboard event listeners jsx-a11y/no-noninteractive-element-interactions + */ +/* eslint-disable */ + import React from 'react'; import PropTypes from 'prop-types'; From 6098dab628b4a2252393335eb721e69caed492d4 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Wed, 31 Oct 2018 09:58:51 -0400 Subject: [PATCH 2/6] disabling eslint for Canvas because we are adding in jsx-a11y rules to eslint. --- .../canvas/public/components/autocomplete/autocomplete.js | 2 +- .../public/components/element_content/invalid_element_type.js | 2 +- .../public/components/element_content/invalid_expression.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js index 97eff5644683b..c3bc0f8206b7d 100644 --- a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js +++ b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -/*disabling eslint because of these jsx-a11y errors: +/*disabling eslint because of these jsx-a11y errors(https://www.npmjs.com/package/eslint-plugin-jsx-a11y): 181:7 error Elements with the 'combobox' interactive role must be focusable jsx-a11y/interactive-supports-focus 187:9 error Elements with the ARIA role "combobox" must have the following attributes defined: aria-controls,aria-expanded jsx-a11y/role-has-required-aria-props 209:23 error Elements with the 'option' interactive role must be focusable jsx-a11y/interactive-supports-focus diff --git a/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js b/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js index 945d31328638c..27f0bcd27df76 100644 --- a/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js +++ b/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -/* Disabling eslint because of this jsx-a11y error: +/* Disabling eslint because of this jsx-a11y error(https://www.npmjs.com/package/eslint-plugin-jsx-a11y): 11:3 error Non-interactive elements should not be assigned mouse or keyboard event listeners jsx-a11y/no-noninteractive-element-interactions */ /* eslint-disable */ diff --git a/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js b/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js index 907c9cae83e88..6e5c1cfb495a8 100644 --- a/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js +++ b/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -/* Disabling eslint because of this jsx-a11y error: +/* Disabling eslint because of this jsx-a11y error(https://www.npmjs.com/package/eslint-plugin-jsx-a11y): 11:3 error Non-interactive elements should not be assigned mouse or keyboard event listeners jsx-a11y/no-noninteractive-element-interactions */ /* eslint-disable */ From 23515363f1a591b439318b83f163ba91ce2727ad Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Wed, 31 Oct 2018 09:58:07 -0400 Subject: [PATCH 3/6] disabling eslint for Canvas because we are adding in jsx-a11y rules to eslint. --- .../public/components/autocomplete/autocomplete.js | 9 +++++++++ .../components/element_content/invalid_element_type.js | 4 ++++ .../components/element_content/invalid_expression.js | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js index a57f367407d89..97eff5644683b 100644 --- a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js +++ b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js @@ -4,6 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ +/*disabling eslint because of these jsx-a11y errors: +181:7 error Elements with the 'combobox' interactive role must be focusable jsx-a11y/interactive-supports-focus + 187:9 error Elements with the ARIA role "combobox" must have the following attributes defined: aria-controls,aria-expanded jsx-a11y/role-has-required-aria-props + 209:23 error Elements with the 'option' interactive role must be focusable jsx-a11y/interactive-supports-focus + 218:25 error Elements with the ARIA role "option" must have the following attributes defined: aria-selected jsx-a11y/role-has-required-aria-props +*/ +/* eslint-disable */ + + import React from 'react'; import PropTypes from 'prop-types'; import { EuiFlexGroup, EuiFlexItem, EuiPanel, keyCodes } from '@elastic/eui'; diff --git a/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js b/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js index 08d8a5294e9a4..945d31328638c 100644 --- a/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js +++ b/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js @@ -3,6 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +/* Disabling eslint because of this jsx-a11y error: +11:3 error Non-interactive elements should not be assigned mouse or keyboard event listeners jsx-a11y/no-noninteractive-element-interactions +*/ +/* eslint-disable */ import React from 'react'; import PropTypes from 'prop-types'; diff --git a/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js b/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js index 0c17f9ac51732..907c9cae83e88 100644 --- a/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js +++ b/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js @@ -4,6 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ +/* Disabling eslint because of this jsx-a11y error: + 11:3 error Non-interactive elements should not be assigned mouse or keyboard event listeners jsx-a11y/no-noninteractive-element-interactions + */ +/* eslint-disable */ + import React from 'react'; import PropTypes from 'prop-types'; From a01beca7bc1bb511cf15de5e054754d7cb6d34d5 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Wed, 31 Oct 2018 09:58:51 -0400 Subject: [PATCH 4/6] disabling eslint for Canvas because we are adding in jsx-a11y rules to eslint. --- .../canvas/public/components/autocomplete/autocomplete.js | 2 +- .../public/components/element_content/invalid_element_type.js | 2 +- .../public/components/element_content/invalid_expression.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js index 97eff5644683b..c3bc0f8206b7d 100644 --- a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js +++ b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -/*disabling eslint because of these jsx-a11y errors: +/*disabling eslint because of these jsx-a11y errors(https://www.npmjs.com/package/eslint-plugin-jsx-a11y): 181:7 error Elements with the 'combobox' interactive role must be focusable jsx-a11y/interactive-supports-focus 187:9 error Elements with the ARIA role "combobox" must have the following attributes defined: aria-controls,aria-expanded jsx-a11y/role-has-required-aria-props 209:23 error Elements with the 'option' interactive role must be focusable jsx-a11y/interactive-supports-focus diff --git a/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js b/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js index 945d31328638c..27f0bcd27df76 100644 --- a/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js +++ b/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -/* Disabling eslint because of this jsx-a11y error: +/* Disabling eslint because of this jsx-a11y error(https://www.npmjs.com/package/eslint-plugin-jsx-a11y): 11:3 error Non-interactive elements should not be assigned mouse or keyboard event listeners jsx-a11y/no-noninteractive-element-interactions */ /* eslint-disable */ diff --git a/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js b/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js index 907c9cae83e88..6e5c1cfb495a8 100644 --- a/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js +++ b/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -/* Disabling eslint because of this jsx-a11y error: +/* Disabling eslint because of this jsx-a11y error(https://www.npmjs.com/package/eslint-plugin-jsx-a11y): 11:3 error Non-interactive elements should not be assigned mouse or keyboard event listeners jsx-a11y/no-noninteractive-element-interactions */ /* eslint-disable */ From 819e87e7246acaceb9ed44f6184e2105701a6683 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Wed, 31 Oct 2018 12:51:58 -0400 Subject: [PATCH 5/6] adding missing a copyright header --- x-pack/plugins/canvas/__tests__/fixtures/function_specs.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x-pack/plugins/canvas/__tests__/fixtures/function_specs.js b/x-pack/plugins/canvas/__tests__/fixtures/function_specs.js index 6a8ffdcc7df04..433b5ec64b753 100644 --- a/x-pack/plugins/canvas/__tests__/fixtures/function_specs.js +++ b/x-pack/plugins/canvas/__tests__/fixtures/function_specs.js @@ -1,3 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + import { Fn } from '../../common/lib/fn'; import { functions as browserFns } from '../../canvas_plugin_src/functions/browser'; import { functions as commonFns } from '../../canvas_plugin_src/functions/common'; From 4e3c58a142b058b890383bd6846a013066e85b27 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Wed, 31 Oct 2018 13:15:05 -0400 Subject: [PATCH 6/6] disabling specific eslint rules --- .../canvas/public/components/autocomplete/autocomplete.js | 4 ++-- .../public/components/element_content/invalid_element_type.js | 2 +- .../public/components/element_content/invalid_expression.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js index c3bc0f8206b7d..439556334c3e4 100644 --- a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js +++ b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js @@ -10,8 +10,8 @@ 209:23 error Elements with the 'option' interactive role must be focusable jsx-a11y/interactive-supports-focus 218:25 error Elements with the ARIA role "option" must have the following attributes defined: aria-selected jsx-a11y/role-has-required-aria-props */ -/* eslint-disable */ - +/* eslint-disable jsx-a11y/interactive-supports-focus */ +/* eslint-disable jsx-a11y/role-has-required-aria-props */ import React from 'react'; import PropTypes from 'prop-types'; diff --git a/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js b/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js index 27f0bcd27df76..33b12ea9b9399 100644 --- a/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js +++ b/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js @@ -6,7 +6,7 @@ /* Disabling eslint because of this jsx-a11y error(https://www.npmjs.com/package/eslint-plugin-jsx-a11y): 11:3 error Non-interactive elements should not be assigned mouse or keyboard event listeners jsx-a11y/no-noninteractive-element-interactions */ -/* eslint-disable */ +/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ import React from 'react'; import PropTypes from 'prop-types'; diff --git a/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js b/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js index 6e5c1cfb495a8..0dcfd92b637cb 100644 --- a/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js +++ b/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js @@ -7,7 +7,7 @@ /* Disabling eslint because of this jsx-a11y error(https://www.npmjs.com/package/eslint-plugin-jsx-a11y): 11:3 error Non-interactive elements should not be assigned mouse or keyboard event listeners jsx-a11y/no-noninteractive-element-interactions */ -/* eslint-disable */ +/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ import React from 'react'; import PropTypes from 'prop-types';