@elastic/eslint-plugin-eui 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -4
- package/lib/cjs/index.js +14 -19
- package/lib/cjs/rules/a11y/accessible_interactive_element.d.ts +3 -0
- package/lib/cjs/rules/a11y/accessible_interactive_element.d.ts.map +1 -0
- package/lib/cjs/rules/a11y/accessible_interactive_element.js +51 -0
- package/lib/cjs/rules/a11y/callout_announce_on_mount.d.ts.map +1 -1
- package/lib/cjs/rules/a11y/callout_announce_on_mount.js +6 -17
- package/lib/cjs/rules/a11y/consistent_is_invalid_props.d.ts.map +1 -1
- package/lib/cjs/rules/a11y/consistent_is_invalid_props.js +7 -18
- package/lib/cjs/rules/a11y/no_unnamed_interactive_element.d.ts.map +1 -1
- package/lib/cjs/rules/a11y/no_unnamed_interactive_element.js +6 -17
- package/lib/cjs/rules/a11y/no_unnamed_radio_group.d.ts.map +1 -1
- package/lib/cjs/rules/a11y/no_unnamed_radio_group.js +5 -16
- package/lib/cjs/rules/a11y/prefer_eui_icon_tip.d.ts.map +1 -1
- package/lib/cjs/rules/a11y/prefer_eui_icon_tip.js +8 -0
- package/lib/cjs/rules/a11y/require_aria_label_for_modals.d.ts.map +1 -1
- package/lib/cjs/rules/a11y/require_aria_label_for_modals.js +5 -16
- package/lib/cjs/rules/a11y/sr_output_disabled_tooltip.js +2 -2
- package/lib/cjs/rules/a11y/tooltip_focusable_anchor.d.ts +3 -0
- package/lib/cjs/rules/a11y/tooltip_focusable_anchor.d.ts.map +1 -0
- package/lib/cjs/rules/a11y/tooltip_focusable_anchor.js +68 -0
- package/lib/cjs/rules/href_or_on_click.d.ts.map +1 -1
- package/lib/cjs/rules/href_or_on_click.js +5 -16
- package/lib/cjs/rules/no_css_color.d.ts.map +1 -1
- package/lib/cjs/rules/no_css_color.js +14 -7
- package/lib/cjs/rules/no_restricted_eui_imports.d.ts.map +1 -1
- package/lib/cjs/rules/no_restricted_eui_imports.js +5 -16
- package/lib/cjs/utils/are_attrs_equal.d.ts.map +1 -1
- package/lib/cjs/utils/are_attrs_equal.js +5 -16
- package/lib/cjs/utils/constants.d.ts +27 -0
- package/lib/cjs/utils/constants.d.ts.map +1 -0
- package/lib/cjs/utils/constants.js +41 -0
- package/lib/cjs/utils/get_allowed_a11y_prop_names_for_component.d.ts.map +1 -1
- package/lib/cjs/utils/get_allowed_a11y_prop_names_for_component.js +5 -16
- package/lib/cjs/utils/get_attr_value.d.ts +2 -1
- package/lib/cjs/utils/get_attr_value.d.ts.map +1 -1
- package/lib/cjs/utils/get_attr_value.js +11 -18
- package/lib/cjs/utils/has_a11y_prop_for_component.d.ts.map +1 -1
- package/lib/cjs/utils/has_a11y_prop_for_component.js +5 -16
- package/lib/cjs/utils/has_spread.d.ts.map +1 -1
- package/lib/cjs/utils/has_spread.js +5 -16
- package/lib/cjs/utils/is_in_conditional_rendering.d.ts.map +1 -1
- package/lib/cjs/utils/is_in_conditional_rendering.js +5 -16
- package/lib/cjs/utils/resolve_member_expression_root.d.ts.map +1 -1
- package/lib/cjs/utils/resolve_member_expression_root.js +8 -0
- package/lib/esm/index.js +12 -17
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/rules/a11y/accessible_interactive_element.d.ts +2 -0
- package/lib/esm/rules/a11y/accessible_interactive_element.js +50 -0
- package/lib/esm/rules/a11y/accessible_interactive_element.js.map +1 -0
- package/lib/esm/rules/a11y/callout_announce_on_mount.js +6 -16
- package/lib/esm/rules/a11y/callout_announce_on_mount.js.map +1 -1
- package/lib/esm/rules/a11y/consistent_is_invalid_props.js +7 -18
- package/lib/esm/rules/a11y/consistent_is_invalid_props.js.map +1 -1
- package/lib/esm/rules/a11y/no_unnamed_interactive_element.js +5 -17
- package/lib/esm/rules/a11y/no_unnamed_interactive_element.js.map +1 -1
- package/lib/esm/rules/a11y/no_unnamed_radio_group.js +5 -16
- package/lib/esm/rules/a11y/no_unnamed_radio_group.js.map +1 -1
- package/lib/esm/rules/a11y/prefer_eui_icon_tip.js +7 -0
- package/lib/esm/rules/a11y/prefer_eui_icon_tip.js.map +1 -1
- package/lib/esm/rules/a11y/require_aria_label_for_modals.js +5 -16
- package/lib/esm/rules/a11y/require_aria_label_for_modals.js.map +1 -1
- package/lib/esm/rules/a11y/sr_output_disabled_tooltip.js +2 -2
- package/lib/esm/rules/a11y/sr_output_disabled_tooltip.js.map +1 -1
- package/lib/esm/rules/a11y/tooltip_focusable_anchor.d.ts +2 -0
- package/lib/esm/rules/a11y/tooltip_focusable_anchor.js +84 -0
- package/lib/esm/rules/a11y/tooltip_focusable_anchor.js.map +1 -0
- package/lib/esm/rules/href_or_on_click.js +5 -16
- package/lib/esm/rules/href_or_on_click.js.map +1 -1
- package/lib/esm/rules/no_css_color.js +22 -7
- package/lib/esm/rules/no_css_color.js.map +1 -1
- package/lib/esm/rules/no_restricted_eui_imports.js +5 -16
- package/lib/esm/rules/no_restricted_eui_imports.js.map +1 -1
- package/lib/esm/utils/are_attrs_equal.js +5 -16
- package/lib/esm/utils/are_attrs_equal.js.map +1 -1
- package/lib/esm/utils/constants.d.ts +26 -0
- package/lib/esm/utils/constants.js +119 -0
- package/lib/esm/utils/constants.js.map +1 -0
- package/lib/esm/utils/get_allowed_a11y_prop_names_for_component.js +5 -16
- package/lib/esm/utils/get_allowed_a11y_prop_names_for_component.js.map +1 -1
- package/lib/esm/utils/get_attr_value.d.ts +2 -1
- package/lib/esm/utils/get_attr_value.js +11 -18
- package/lib/esm/utils/get_attr_value.js.map +1 -1
- package/lib/esm/utils/has_a11y_prop_for_component.js +5 -16
- package/lib/esm/utils/has_a11y_prop_for_component.js.map +1 -1
- package/lib/esm/utils/has_spread.js +5 -16
- package/lib/esm/utils/has_spread.js.map +1 -1
- package/lib/esm/utils/is_in_conditional_rendering.js +5 -16
- package/lib/esm/utils/is_in_conditional_rendering.js.map +1 -1
- package/lib/esm/utils/resolve_member_expression_root.js +7 -0
- package/lib/esm/utils/resolve_member_expression_root.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,22 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.areAttrsEqual = void 0;
|
|
7
7
|
/*
|
|
8
|
-
*
|
|
9
|
-
* license agreements.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* not use this file except in compliance with the License.
|
|
14
|
-
* You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing,
|
|
19
|
-
* software distributed under the License is distributed on an
|
|
20
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
21
|
-
* KIND, either express or implied. See the License for the
|
|
22
|
-
* specific language governing permissions and limitations
|
|
23
|
-
* under the License.
|
|
8
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
+
* Side Public License, v 1.
|
|
24
13
|
*/
|
|
25
14
|
|
|
26
15
|
const normalizeAttrString = str => str?.trim().replace(/\s+/g, ' ');
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A list of standard HTML tags that are considered **non-interactive** elements.
|
|
3
|
+
*
|
|
4
|
+
* These tags generally do not provide any built-in user interaction
|
|
5
|
+
* (such as click, input, or focus behavior) and are typically used for
|
|
6
|
+
* layout, structure, or content presentation rather than direct
|
|
7
|
+
* interactivity.
|
|
8
|
+
*
|
|
9
|
+
* This constant can be useful when:
|
|
10
|
+
* - Determining whether an element should be treated as interactive.
|
|
11
|
+
* - Enforcing accessibility rules (e.g., ensuring interactive behavior is only applied to proper elements).
|
|
12
|
+
* - Filtering DOM nodes when processing or analyzing HTML structures.
|
|
13
|
+
*/
|
|
14
|
+
export declare const NON_INTERACTIVE_HTML_TAGS: string[];
|
|
15
|
+
/**
|
|
16
|
+
* A list of Elastic UI (EUI) React components that are considered **interactive**.
|
|
17
|
+
*
|
|
18
|
+
* These components are designed to be focusable and respond to user actions
|
|
19
|
+
* such as clicks, keyboard events, or other interactions. Use this constant
|
|
20
|
+
* when you need to determine if a given EUI component is inherently interactive,
|
|
21
|
+
* for example, when enforcing accessibility rules or filtering components
|
|
22
|
+
* for focus management.
|
|
23
|
+
*
|
|
24
|
+
* This list should be kept up to date with EUI's interactive component offerings.
|
|
25
|
+
*/
|
|
26
|
+
export declare const INTERACTIVE_EUI_COMPONENTS: string[];
|
|
27
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,UAyCrC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B,UAyCtC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NON_INTERACTIVE_HTML_TAGS = exports.INTERACTIVE_EUI_COMPONENTS = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
+
* Side Public License, v 1.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A list of standard HTML tags that are considered **non-interactive** elements.
|
|
17
|
+
*
|
|
18
|
+
* These tags generally do not provide any built-in user interaction
|
|
19
|
+
* (such as click, input, or focus behavior) and are typically used for
|
|
20
|
+
* layout, structure, or content presentation rather than direct
|
|
21
|
+
* interactivity.
|
|
22
|
+
*
|
|
23
|
+
* This constant can be useful when:
|
|
24
|
+
* - Determining whether an element should be treated as interactive.
|
|
25
|
+
* - Enforcing accessibility rules (e.g., ensuring interactive behavior is only applied to proper elements).
|
|
26
|
+
* - Filtering DOM nodes when processing or analyzing HTML structures.
|
|
27
|
+
*/
|
|
28
|
+
const NON_INTERACTIVE_HTML_TAGS = exports.NON_INTERACTIVE_HTML_TAGS = ['div', 'span', 'p', 'article', 'aside', 'blockquote', 'br', 'caption', 'code', 'dd', 'dl', 'dt', 'figcaption', 'figure', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'img', 'li', 'main', 'nav', 'ol', 'pre', 'section', 'small', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'ul'];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A list of Elastic UI (EUI) React components that are considered **interactive**.
|
|
32
|
+
*
|
|
33
|
+
* These components are designed to be focusable and respond to user actions
|
|
34
|
+
* such as clicks, keyboard events, or other interactions. Use this constant
|
|
35
|
+
* when you need to determine if a given EUI component is inherently interactive,
|
|
36
|
+
* for example, when enforcing accessibility rules or filtering components
|
|
37
|
+
* for focus management.
|
|
38
|
+
*
|
|
39
|
+
* This list should be kept up to date with EUI's interactive component offerings.
|
|
40
|
+
*/
|
|
41
|
+
const INTERACTIVE_EUI_COMPONENTS = exports.INTERACTIVE_EUI_COMPONENTS = ['EuiLink', 'EuiButton', 'EuiButtonEmpty', 'EuiButtonIcon', 'EuiFacetButton', 'EuiHeaderLink', 'EuiHeaderSectionItemButton', 'EuiHeaderLogo', 'EuiListGroupItem', 'EuiPinnableListGroup', 'EuiSideNav', 'EuiBreadcrumbs', 'EuiTab', 'EuiContextMenuItem', 'EuiKeyPadMenuItem', 'EuiPagination', 'EuiTreeView', 'EuiStepHorizontal', 'EuiCard', 'EuiCheckableCard', 'EuiBasicTable', 'EuiInMemoryTable', 'EuiFilterButton', 'EuiFilterSelectItem', 'EuiFilterSelectable', 'EuiBadge', 'EuiBetaBadge', 'EuiSelectable', 'EuiComboBox', 'EuiSuperSelect', 'EuiSelect', 'EuiCheckbox', 'EuiRadio', 'EuiSwitch', 'EuiButtonGroup', 'EuiRange', 'EuiDualRange', 'EuiColorPicker', 'EuiDatePicker', 'EuiSuperDatePicker'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_allowed_a11y_prop_names_for_component.d.ts","sourceRoot":"","sources":["../../../src/utils/get_allowed_a11y_prop_names_for_component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get_allowed_a11y_prop_names_for_component.d.ts","sourceRoot":"","sources":["../../../src/utils/get_allowed_a11y_prop_names_for_component.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,8BAA8B,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtD,kBAAkB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,mCAAmC,CACjD,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,UAAU,GACd,MAAM,EAAE,CAUV"}
|
|
@@ -5,22 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getAllowedA11yPropNamesForComponent = getAllowedA11yPropNamesForComponent;
|
|
7
7
|
/*
|
|
8
|
-
*
|
|
9
|
-
* license agreements.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* not use this file except in compliance with the License.
|
|
14
|
-
* You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing,
|
|
19
|
-
* software distributed under the License is distributed on an
|
|
20
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
21
|
-
* KIND, either express or implied. See the License for the
|
|
22
|
-
* specific language governing permissions and limitations
|
|
23
|
-
* under the License.
|
|
8
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
+
* Side Public License, v 1.
|
|
24
13
|
*/
|
|
25
14
|
|
|
26
15
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { type TSESTree, type TSESLint } from '@typescript-eslint/utils';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function findAttrValue<TContext extends TSESLint.RuleContext<string, unknown[]>>(context: TContext, attributes: TSESTree.JSXOpeningElement['attributes'], attrName: string): string | undefined;
|
|
3
|
+
export declare function extractAttrValue<TContext extends TSESLint.RuleContext<string, unknown[]>>(context: TContext, attr: TSESTree.JSXAttribute | undefined): string | undefined;
|
|
3
4
|
//# sourceMappingURL=get_attr_value.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_attr_value.d.ts","sourceRoot":"","sources":["../../../src/utils/get_attr_value.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get_attr_value.d.ts","sourceRoot":"","sources":["../../../src/utils/get_attr_value.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAEvE,wBAAgB,aAAa,CAC3B,QAAQ,SAAS,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAExD,OAAO,EAAE,QAAQ,EACjB,UAAU,EAAE,QAAQ,CAAC,iBAAiB,CAAC,YAAY,CAAC,EACpD,QAAQ,EAAE,MAAM,sBAUjB;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,SAAS,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAExD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,QAAQ,CAAC,YAAY,GAAG,SAAS,GACtC,MAAM,GAAG,SAAS,CAqBpB"}
|
|
@@ -3,28 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.extractAttrValue = extractAttrValue;
|
|
7
|
+
exports.findAttrValue = findAttrValue;
|
|
7
8
|
/*
|
|
8
|
-
*
|
|
9
|
-
* license agreements.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* not use this file except in compliance with the License.
|
|
14
|
-
* You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing,
|
|
19
|
-
* software distributed under the License is distributed on an
|
|
20
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
21
|
-
* KIND, either express or implied. See the License for the
|
|
22
|
-
* specific language governing permissions and limitations
|
|
23
|
-
* under the License.
|
|
9
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
10
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
11
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
12
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
13
|
+
* Side Public License, v 1.
|
|
24
14
|
*/
|
|
25
15
|
|
|
26
|
-
function
|
|
16
|
+
function findAttrValue(context, attributes, attrName) {
|
|
27
17
|
const attr = attributes.find(attr => attr.type === 'JSXAttribute' && attr.name.type === 'JSXIdentifier' && attr.name.name === attrName);
|
|
18
|
+
return extractAttrValue(context, attr);
|
|
19
|
+
}
|
|
20
|
+
function extractAttrValue(context, attr) {
|
|
28
21
|
if (!attr?.value) {
|
|
29
22
|
return undefined;
|
|
30
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has_a11y_prop_for_component.d.ts","sourceRoot":"","sources":["../../../src/utils/has_a11y_prop_for_component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"has_a11y_prop_for_component.d.ts","sourceRoot":"","sources":["../../../src/utils/has_a11y_prop_for_component.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,6CAA6C,CAAC;AAErD;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAC/C,GAAG,EAAE,UAAU,GACd,OAAO,CAUT"}
|
|
@@ -6,22 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.hasA11yPropForComponent = hasA11yPropForComponent;
|
|
7
7
|
var _get_allowed_a11y_prop_names_for_component = require("./get_allowed_a11y_prop_names_for_component");
|
|
8
8
|
/*
|
|
9
|
-
*
|
|
10
|
-
* license agreements.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* not use this file except in compliance with the License.
|
|
15
|
-
* You may obtain a copy of the License at
|
|
16
|
-
*
|
|
17
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
-
*
|
|
19
|
-
* Unless required by applicable law or agreed to in writing,
|
|
20
|
-
* software distributed under the License is distributed on an
|
|
21
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
22
|
-
* KIND, either express or implied. See the License for the
|
|
23
|
-
* specific language governing permissions and limitations
|
|
24
|
-
* under the License.
|
|
9
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
10
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
11
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
12
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
13
|
+
* Side Public License, v 1.
|
|
25
14
|
*/
|
|
26
15
|
|
|
27
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has_spread.d.ts","sourceRoot":"","sources":["../../../src/utils/has_spread.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"has_spread.d.ts","sourceRoot":"","sources":["../../../src/utils/has_spread.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;;;;;;GAQG;AAEH,wBAAgB,SAAS,CACvB,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,YAAY,CAAC,GAC9C,OAAO,CAET"}
|
|
@@ -5,22 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.hasSpread = hasSpread;
|
|
7
7
|
/*
|
|
8
|
-
*
|
|
9
|
-
* license agreements.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* not use this file except in compliance with the License.
|
|
14
|
-
* You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing,
|
|
19
|
-
* software distributed under the License is distributed on an
|
|
20
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
21
|
-
* KIND, either express or implied. See the License for the
|
|
22
|
-
* specific language governing permissions and limitations
|
|
23
|
-
* under the License.
|
|
8
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
+
* Side Public License, v 1.
|
|
24
13
|
*/
|
|
25
14
|
|
|
26
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is_in_conditional_rendering.d.ts","sourceRoot":"","sources":["../../../src/utils/is_in_conditional_rendering.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is_in_conditional_rendering.d.ts","sourceRoot":"","sources":["../../../src/utils/is_in_conditional_rendering.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,OAAO,CAW3E"}
|
|
@@ -5,22 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.isInConditionalRendering = isInConditionalRendering;
|
|
7
7
|
/*
|
|
8
|
-
*
|
|
9
|
-
* license agreements.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* not use this file except in compliance with the License.
|
|
14
|
-
* You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing,
|
|
19
|
-
* software distributed under the License is distributed on an
|
|
20
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
21
|
-
* KIND, either express or implied. See the License for the
|
|
22
|
-
* specific language governing permissions and limitations
|
|
23
|
-
* under the License.
|
|
8
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
+
* Side Public License, v 1.
|
|
24
13
|
*/
|
|
25
14
|
|
|
26
15
|
function isInConditionalRendering(node) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve_member_expression_root.d.ts","sourceRoot":"","sources":["../../../src/utils/resolve_member_expression_root.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve_member_expression_root.d.ts","sourceRoot":"","sources":["../../../src/utils/resolve_member_expression_root.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhE,eAAO,MAAM,2BAA2B,GACtC,MAAM,QAAQ,CAAC,gBAAgB,KAC9B,QAAQ,CAAC,UAMX,CAAC"}
|
|
@@ -4,6 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.resolveMemberExpressionRoot = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
+
* Side Public License, v 1.
|
|
13
|
+
*/
|
|
14
|
+
|
|
7
15
|
const resolveMemberExpressionRoot = node => {
|
|
8
16
|
if (node.object.type === 'MemberExpression') {
|
|
9
17
|
return resolveMemberExpressionRoot(node.object);
|
package/lib/esm/index.js
CHANGED
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
*
|
|
4
|
-
* license agreements.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing,
|
|
14
|
-
* software distributed under the License is distributed on an
|
|
15
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
* KIND, either express or implied. See the License for the
|
|
17
|
-
* specific language governing permissions and limitations
|
|
18
|
-
* under the License.
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
19
8
|
*/
|
|
20
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
const callout_announce_on_mount_1 = require("./rules/a11y/callout_announce_on_mount");
|
|
22
10
|
const href_or_on_click_1 = require("./rules/href_or_on_click");
|
|
23
11
|
const no_restricted_eui_imports_1 = require("./rules/no_restricted_eui_imports");
|
|
24
12
|
const no_css_color_1 = require("./rules/no_css_color");
|
|
@@ -28,6 +16,9 @@ const sr_output_disabled_tooltip_1 = require("./rules/a11y/sr_output_disabled_to
|
|
|
28
16
|
const prefer_eui_icon_tip_1 = require("./rules/a11y/prefer_eui_icon_tip");
|
|
29
17
|
const no_unnamed_radio_group_1 = require("./rules/a11y/no_unnamed_radio_group");
|
|
30
18
|
const no_unnamed_interactive_element_1 = require("./rules/a11y/no_unnamed_interactive_element");
|
|
19
|
+
const tooltip_focusable_anchor_1 = require("./rules/a11y/tooltip_focusable_anchor");
|
|
20
|
+
const callout_announce_on_mount_1 = require("./rules/a11y/callout_announce_on_mount");
|
|
21
|
+
const accessible_interactive_element_1 = require("./rules/a11y/accessible_interactive_element");
|
|
31
22
|
const config = {
|
|
32
23
|
rules: {
|
|
33
24
|
'href-or-on-click': href_or_on_click_1.HrefOnClick,
|
|
@@ -40,6 +31,8 @@ const config = {
|
|
|
40
31
|
'no-unnamed-radio-group': no_unnamed_radio_group_1.NoUnnamedRadioGroup,
|
|
41
32
|
'callout-announce-on-mount': callout_announce_on_mount_1.CallOutAnnounceOnMount,
|
|
42
33
|
'no-unnamed-interactive-element': no_unnamed_interactive_element_1.NoUnnamedInteractiveElement,
|
|
34
|
+
'tooltip-focusable-anchor': tooltip_focusable_anchor_1.TooltipFocusableAnchor,
|
|
35
|
+
'accessible-interactive-element': accessible_interactive_element_1.AccessibleInteractiveElements,
|
|
43
36
|
},
|
|
44
37
|
configs: {
|
|
45
38
|
recommended: {
|
|
@@ -55,6 +48,8 @@ const config = {
|
|
|
55
48
|
'@elastic/eui/no-unnamed-radio-group': 'warn',
|
|
56
49
|
'@elastic/eui/callout-announce-on-mount': 'warn',
|
|
57
50
|
'@elastic/eui/no-unnamed-interactive-element': 'warn',
|
|
51
|
+
'@elastic/eui/tooltip-focusable-anchor': 'warn',
|
|
52
|
+
'@elastic/eui/accessible-interactive-element': 'warn',
|
|
58
53
|
},
|
|
59
54
|
},
|
|
60
55
|
},
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAGH,+DAAuD;AACvD,iFAA2E;AAC3E,uDAAkD;AAElD,8FAAuF;AACvF,0FAAoF;AACpF,wFAA4F;AAC5F,0EAAoE;AACpE,gFAA0E;AAC1E,gGAA0F;AAC1F,oFAA+E;AAC/E,sFAAgF;AAChF,gGAA4F;AAE5F,MAAM,MAAM,GAAG;IACb,KAAK,EAAE;QACL,kBAAkB,EAAE,8BAAW;QAC/B,2BAA2B,EAAE,kDAAsB;QACnD,cAAc,EAAE,yBAAU;QAC1B,+BAA+B,EAAE,yDAAyB;QAC1D,6BAA6B,EAAE,sDAAwB;QACvD,4BAA4B,EAAE,8DAAiC;QAC/D,qBAAqB,EAAE,sCAAgB;QACvC,wBAAwB,EAAG,4CAAmB;QAC9C,2BAA2B,EAAE,kDAAsB;QACnD,gCAAgC,EAAE,4DAA2B;QAC7D,0BAA0B,EAAE,iDAAsB;QAClD,gCAAgC,EAAE,8DAA6B;KAChE;IACD,OAAO,EAAE;QACP,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,4BAA4B,CAAC;YACvC,KAAK,EAAE;gBACL,+BAA+B,EAAE,MAAM;gBACvC,wCAAwC,EAAE,MAAM;gBAChD,2BAA2B,EAAE,MAAM;gBACnC,4CAA4C,EAAE,MAAM;gBACpD,0CAA0C,EAAE,MAAM;gBAClD,yCAAyC,EAAE,MAAM;gBACjD,kCAAkC,EAAE,MAAM;gBAC1C,qCAAqC,EAAE,MAAM;gBAC7C,wCAAwC,EAAE,MAAM;gBAChD,6CAA6C,EAAE,MAAM;gBACrD,uCAAuC,EAAE,MAAM;gBAC/C,6CAA6C,EAAE,MAAM;aACtD;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.AccessibleInteractiveElements = void 0;
|
|
11
|
+
const utils_1 = require("@typescript-eslint/utils");
|
|
12
|
+
const constants_1 = require("../../utils/constants");
|
|
13
|
+
const get_attr_value_1 = require("../../utils/get_attr_value");
|
|
14
|
+
exports.AccessibleInteractiveElements = utils_1.ESLintUtils.RuleCreator.withoutDocs({
|
|
15
|
+
create(context) {
|
|
16
|
+
return {
|
|
17
|
+
JSXOpeningElement(node) {
|
|
18
|
+
if (node.name.type !== 'JSXIdentifier')
|
|
19
|
+
return;
|
|
20
|
+
const componentName = node.name.name;
|
|
21
|
+
if (!constants_1.INTERACTIVE_EUI_COMPONENTS.includes(componentName))
|
|
22
|
+
return;
|
|
23
|
+
const tabIndexAttribute = node.attributes.find((attr) => attr.type === 'JSXAttribute' &&
|
|
24
|
+
attr.name.type === 'JSXIdentifier' &&
|
|
25
|
+
attr.name.name === 'tabIndex');
|
|
26
|
+
if (tabIndexAttribute && (Number((0, get_attr_value_1.extractAttrValue)(context, tabIndexAttribute)) || 0) === -1) {
|
|
27
|
+
context.report({
|
|
28
|
+
node: node,
|
|
29
|
+
messageId: 'disallowTabIndex',
|
|
30
|
+
data: { component: componentName },
|
|
31
|
+
fix: fixer => fixer.remove(tabIndexAttribute),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
meta: {
|
|
38
|
+
type: 'problem',
|
|
39
|
+
docs: {
|
|
40
|
+
description: 'Ensure interactive EUI components remain accessible by prohibiting tabIndex={-1}, which removes them from keyboard navigation.',
|
|
41
|
+
},
|
|
42
|
+
fixable: 'code',
|
|
43
|
+
schema: [],
|
|
44
|
+
messages: {
|
|
45
|
+
disallowTabIndex: '{{component}} is an interactive EUI component and must not use tabIndex={-1}, as this removes it from keyboard navigation and impairs accessibility.',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
defaultOptions: [],
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=accessible_interactive_element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessible_interactive_element.js","sourceRoot":"","sources":["../../../../src/rules/a11y/accessible_interactive_element.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,oDAAsE;AACtE,qDAAmE;AACnE,+DAA8D;AAEjD,QAAA,6BAA6B,GAAG,mBAAW,CAAC,WAAW,CAAC,WAAW,CAAC;IAC/E,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,iBAAiB,CAAC,IAAI;gBACpB,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe;oBAAE,OAAO;gBAC/C,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;gBACrC,IAAI,CAAC,sCAA0B,CAAC,QAAQ,CAAC,aAAa,CAAC;oBAAE,OAAO;gBAEhE,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAC5C,CAAC,IAAI,EAAiC,EAAE,CACtC,IAAI,CAAC,IAAI,KAAK,cAAc;oBAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe;oBAClC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAChC,CAAC;gBAGF,IAAI,iBAAiB,IAAI,CAAC,MAAM,CAAC,IAAA,iCAAgB,EAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;oBAC5F,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAG,IAAI;wBACX,SAAS,EAAE,kBAAkB;wBAC7B,IAAI,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE;wBAClC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC;qBAC9C,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,gIAAgI;SAC9I;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,gBAAgB,EAAE,sJAAsJ;SACzK;KACF;IACD,cAAc,EAAE,EAAE;CACnB,CAAC,CAAC"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
*
|
|
4
|
-
* license agreements.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing,
|
|
14
|
-
* software distributed under the License is distributed on an
|
|
15
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
* KIND, either express or implied. See the License for the
|
|
17
|
-
* specific language governing permissions and limitations
|
|
18
|
-
* under the License.
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
19
8
|
*/
|
|
20
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
10
|
exports.CallOutAnnounceOnMount = void 0;
|
|
@@ -64,6 +53,7 @@ exports.CallOutAnnounceOnMount = utils_1.ESLintUtils.RuleCreator.withoutDocs({
|
|
|
64
53
|
'screen readers may not announce its content. Adding `announceOnMount` ensures the callout',
|
|
65
54
|
'is properly announced to users with assistive technologies.',
|
|
66
55
|
'\n',
|
|
56
|
+
`Note: If ${CALLOUT_COMPONENT} is inside a condition and not an action, explicitly set \`announceOnMount={false}\``,
|
|
67
57
|
'Example:',
|
|
68
58
|
` <${CALLOUT_COMPONENT} announceOnMount title="Error" color="danger">`,
|
|
69
59
|
' This message will be announced when it appears',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callout_announce_on_mount.js","sourceRoot":"","sources":["../../../../src/rules/a11y/callout_announce_on_mount.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"callout_announce_on_mount.js","sourceRoot":"","sources":["../../../../src/rules/a11y/callout_announce_on_mount.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,oDAAwD;AACxD,yFAAmF;AACnF,uDAAmD;AAEnD,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAE1B,QAAA,sBAAsB,GAAG,mBAAW,CAAC,WAAW,CAAC,WAAW,CAAC;IACxE,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,UAAU,CAAC,IAAI;gBACb,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;gBAChC,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe;oBAC5C,cAAc,CAAC,IAAI,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;oBACnD,OAAO;gBACT,CAAC;gBACD,IAAI,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACxC,IAAI,CAAC,IAAI,KAAK,cAAc;oBAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe;oBAClC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,iBAAiB,CACrC,EAAE,CAAC;oBACF,OAAO;gBACT,CAAC;gBACD,IAAI,IAAA,sDAAwB,EAAC,IAAI,CAAC,EAAE,CAAC;oBACnC,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,cAAc;wBACpB,SAAS,EAAE,wBAAwB;wBACnC,GAAG,EAAE,IAAA,sBAAS,EAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;4BAChE,OAAO,KAAK,CAAC,oBAAoB,CAC/B,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC5D,kBAAkB,CACnB,CAAC;wBACJ,CAAC;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,UAAU,iBAAiB,gGAAgG;SACzI;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,sBAAsB,EAAE;gBACtB,GAAG,iBAAiB,6FAA6F;gBACjH,IAAI;gBACJ,QAAQ,iBAAiB,6EAA6E;gBACtG,2FAA2F;gBAC3F,6DAA6D;gBAC7D,IAAI;gBACJ,YAAY,iBAAiB,sFAAsF;gBACnH,UAAU;gBACV,MAAM,iBAAiB,gDAAgD;gBACvE,oDAAoD;gBACpD,OAAO,iBAAiB,GAAG;aAC5B,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF;IACD,cAAc,EAAE,EAAE;CACnB,CAAC,CAAC"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
*
|
|
4
|
-
* license agreements.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing,
|
|
14
|
-
* software distributed under the License is distributed on an
|
|
15
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
* KIND, either express or implied. See the License for the
|
|
17
|
-
* specific language governing permissions and limitations
|
|
18
|
-
* under the License.
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
19
8
|
*/
|
|
20
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
10
|
exports.ConsistentIsInvalidProps = void 0;
|
|
@@ -43,7 +32,7 @@ exports.ConsistentIsInvalidProps = utils_1.ESLintUtils.RuleCreator.withoutDocs({
|
|
|
43
32
|
openingElement.attributes.length === 0) {
|
|
44
33
|
return;
|
|
45
34
|
}
|
|
46
|
-
const formRowIsInvalid = (0, get_attr_value_1.
|
|
35
|
+
const formRowIsInvalid = (0, get_attr_value_1.findAttrValue)(context, openingElement.attributes, 'isInvalid');
|
|
47
36
|
if (formRowIsInvalid === undefined) {
|
|
48
37
|
return;
|
|
49
38
|
}
|
|
@@ -53,7 +42,7 @@ exports.ConsistentIsInvalidProps = utils_1.ESLintUtils.RuleCreator.withoutDocs({
|
|
|
53
42
|
if (!childElement) {
|
|
54
43
|
return;
|
|
55
44
|
}
|
|
56
|
-
const childIsInvalid = (0, get_attr_value_1.
|
|
45
|
+
const childIsInvalid = (0, get_attr_value_1.findAttrValue)(context, childElement.openingElement.attributes, 'isInvalid');
|
|
57
46
|
if (!(0, are_attrs_equal_1.areAttrsEqual)(childIsInvalid, formRowIsInvalid)) {
|
|
58
47
|
const componentName = childElement.openingElement.name.name;
|
|
59
48
|
context.report({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consistent_is_invalid_props.js","sourceRoot":"","sources":["../../../../src/rules/a11y/consistent_is_invalid_props.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"consistent_is_invalid_props.js","sourceRoot":"","sources":["../../../../src/rules/a11y/consistent_is_invalid_props.ts"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Ac,EAAE,EAAE;CACnB,CAAC,CAAC"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
*
|
|
4
|
-
* license agreements.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing,
|
|
14
|
-
* software distributed under the License is distributed on an
|
|
15
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
* KIND, either express or implied. See the License for the
|
|
17
|
-
* specific language governing permissions and limitations
|
|
18
|
-
* under the License.
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
19
8
|
*/
|
|
20
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
10
|
exports.NoUnnamedInteractiveElement = void 0;
|
|
@@ -25,7 +14,6 @@ const get_allowed_a11y_prop_names_for_component_1 = require("../../utils/get_all
|
|
|
25
14
|
const has_a11y_prop_for_component_1 = require("../../utils/has_a11y_prop_for_component");
|
|
26
15
|
const interactiveComponents = [
|
|
27
16
|
'EuiBetaBadge',
|
|
28
|
-
'EuiButtonEmpty',
|
|
29
17
|
'EuiButtonIcon',
|
|
30
18
|
'EuiComboBox',
|
|
31
19
|
'EuiSelect',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no_unnamed_interactive_element.js","sourceRoot":"","sources":["../../../../src/rules/a11y/no_unnamed_interactive_element.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"no_unnamed_interactive_element.js","sourceRoot":"","sources":["../../../../src/rules/a11y/no_unnamed_interactive_element.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,oDAAsE;AACtE,uDAAmD;AACnD,qHAG+D;AAC/D,yFAAkF;AAElF,MAAM,qBAAqB,GAAG;IAC5B,cAAc;IACd,eAAe;IACf,aAAa;IACb,WAAW;IACX,oBAAoB;IACpB,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,gBAAgB;CACR,CAAC;AAEX,MAAM,kBAAkB,GAAG,CAAC,YAAY,CAAU,CAAC;AACnD,MAAM,8BAA8B,GAAG,CAAC,cAAc,CAAU,CAAC;AACjE,MAAM,aAAa,GAAG,CAAC,YAAY,EAAE,iBAAiB,CAAU,CAAC;AAEjE,6DAA6D;AAC7D,MAAM,UAAU,GAAe;IAC7B,8BAA8B,EAAE,CAAC,GAAG,8BAA8B,CAAC;IACnE,kBAAkB,EAAE,CAAC,GAAG,kBAAkB,CAAC;IAC3C,aAAa,EAAE,CAAC,GAAG,aAAa,CAAC;CAClC,CAAC;AAEW,QAAA,2BAA2B,GAAG,mBAAW,CAAC,WAAW,CAAC,WAAW,CAAC;IAC7E,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,cAAc,EAAE,KAAK;QACrB,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,WAAW,EACT,2EAA2E;SAC9E;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QAEtC,SAAS,MAAM,CAAC,OAAmC;YACjD,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe;gBAAE,OAAO;YAClD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACpC,MAAM,OAAO,GAAG,IAAA,+EAAmC,EAAC,SAAS,EAAE,UAAU,CAAC,CAAC,IAAI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