diff --git a/.eslintrc.js b/.eslintrc.js index 6649f30e7..e0727c8fa 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -42,7 +42,7 @@ module.exports = { 'react/require-default-props': 1, 'react/destructuring-assignment': 0, 'react/no-find-dom-node': 1, - 'react/no-array-index-key': 1, + 'react/no-array-index-key': 2, 'react/button-has-type': 1, 'jsx-a11y/click-events-have-key-events': 1, 'jsx-a11y/no-noninteractive-tabindex': 1, diff --git a/src/scripts/AutoAlign.js b/src/scripts/AutoAlign.js index fa0ef01b7..9885d26d4 100644 --- a/src/scripts/AutoAlign.js +++ b/src/scripts/AutoAlign.js @@ -162,6 +162,7 @@ export default function autoAlign(options) { } catch (e) { targetEl = null; } + // eslint-disable-next-line react/destructuring-assignment const oldTriggerRect = this.state.triggerRect; if (targetEl) { const { @@ -232,7 +233,9 @@ export default function autoAlign(options) { render() { const { triggerRect } = this.state; const { + // eslint-disable-next-line react/destructuring-assignment align = this.state.horizAlign, + // eslint-disable-next-line react/destructuring-assignment vertAlign = this.state.vertAlign, portalClassName: additionalPortalClassName, portalStyle: additionalPortalStyle = {}, diff --git a/src/scripts/Datepicker.js b/src/scripts/Datepicker.js index ffd7607a5..b66d7dc3c 100644 --- a/src/scripts/Datepicker.js +++ b/src/scripts/Datepicker.js @@ -250,6 +250,7 @@ export default class Datepicker extends Component { {moment.weekdaysMin(true).map((wd, i) => ( + // eslint-disable-next-line react/no-array-index-key {wd} @@ -258,6 +259,7 @@ export default class Datepicker extends Component { {cal.weeks.map((days, i) => ( + // eslint-disable-next-line react/no-array-index-key {days.map(this.renderDate.bind(this, cal, selectedDate, today))} diff --git a/src/scripts/Table.js b/src/scripts/Table.js index ad282651d..ee4b4b579 100644 --- a/src/scripts/Table.js +++ b/src/scripts/Table.js @@ -17,6 +17,7 @@ export class TableHeader extends Component { const childSortable = child.props.sortable; nextChildren.push( React.cloneElement(child, { + // eslint-disable-next-line react/no-array-index-key key: index, sortable: typeof childSortable === 'undefined' ? sortable : childSortable, diff --git a/stories/IconStories.js b/stories/IconStories.js index 05cf4ac59..18636ce1c 100644 --- a/stories/IconStories.js +++ b/stories/IconStories.js @@ -1,3 +1,4 @@ +/* eslint-disable react/no-array-index-key */ import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/stories/ModalStories.js b/stories/ModalStories.js index 6400facea..ac2ef0d33 100644 --- a/stories/ModalStories.js +++ b/stories/ModalStories.js @@ -175,6 +175,7 @@ storiesOf('Modal', module) ))} diff --git a/test/breadcrumbs-spec.js b/test/breadcrumbs-spec.js index ee2ecc72d..697cd6c92 100644 --- a/test/breadcrumbs-spec.js +++ b/test/breadcrumbs-spec.js @@ -35,6 +35,7 @@ describe('BreadCrumbs', () => { const wrapper = shallow( {items.map((item, index) => ( + // eslint-disable-next-line react/no-array-index-key {item.label}