Skip to content

Commit

Permalink
chore(NA): upgrade typescript-eslint packages to v5.14.0 (elastic#127275
Browse files Browse the repository at this point in the history
)

* chore(NA): upgrade typescript-eslint packages to v5.14.0

* chore(NA): ignore required quotes

* Update packages/elastic-eslint-config-kibana/typescript.js

Co-authored-by: Spencer <email@spalger.com>

* chore(NA): remove old lint disable comments

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Spencer <spencer@elastic.co>
Co-authored-by: Spencer <email@spalger.com>
  • Loading branch information
4 people authored Mar 10, 2022
1 parent c4a5a38 commit 8cd75df
Show file tree
Hide file tree
Showing 56 changed files with 67 additions and 146 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,9 @@
"@types/yargs": "^15.0.0",
"@types/yauzl": "^2.9.1",
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^5.13.0",
"@typescript-eslint/parser": "^5.13.0",
"@typescript-eslint/typescript-estree": "^5.13.0",
"@typescript-eslint/eslint-plugin": "^5.14.0",
"@typescript-eslint/parser": "^5.14.0",
"@typescript-eslint/typescript-estree": "^5.14.0",
"@yarnpkg/lockfile": "^1.1.0",
"abab": "^2.0.4",
"aggregate-error": "^3.1.0",
Expand Down
16 changes: 16 additions & 0 deletions packages/elastic-eslint-config-kibana/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,22 @@ module.exports = {
selector: 'enum',
format: ['PascalCase', 'UPPER_CASE', 'camelCase'],
},
// https://typescript-eslint.io/rules/naming-convention/#ignore-properties-that-require-quotes
// restore check behavior before https://github.com/typescript-eslint/typescript-eslint/pull/4582
{
selector: [
'classProperty',
'objectLiteralProperty',
'typeProperty',
'classMethod',
'objectLiteralMethod',
'typeMethod',
'accessor',
'enumMember'
],
format: null,
modifiers: ['requiresQuotes']
}
],
'@typescript-eslint/explicit-member-accessibility': ['error',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ describe('checkCompatibleTypeDescriptor', () => {
]);
expect(incompatibles).toHaveLength(1);
const { diff, message } = incompatibles[0];
// eslint-disable-next-line @typescript-eslint/naming-convention
expect(diff).toEqual({ '@@INDEX@@.count_2.kind': 'number' });
expect(message).toHaveLength(1);
expect(message).toEqual([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,7 @@ export class Field extends PureComponent<FieldProps> {
const isInvalid = unsavedChanges?.isInvalid;

const className = classNames('mgtAdvancedSettings__field', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'mgtAdvancedSettings__field--unsaved': unsavedChanges,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mgtAdvancedSettings__field--invalid': isInvalid,
});
const groupId = `${setting.name}-group`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ export const MetricVisValue = ({
autoScale,
}: MetricVisValueProps) => {
const containerClassName = classNames('mtrVis__container', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'mtrVis__container--light': metric.lightText,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mtrVis__container-isfilterable': onFilter,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mtrVis__container-isfull': !autoScale && colorFullBackground,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ export const ColorPicker = ({
size="l"
color={selectedColor}
className={classNames('visColorPicker__valueDot', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'visColorPicker__valueDot-isSelected': color === selectedColor,
})}
style={{ color }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const LegendToggleComponent = ({ onClick, showLegend, legendPosition }: LegendTo
color="text"
onClick={onClick}
className={classNames('echLegend__toggle', `echLegend__toggle--position-${legendPosition}`, {
// eslint-disable-next-line @typescript-eslint/naming-convention
'echLegend__toggle--isOpen': showLegend,
})}
aria-label={i18n.translate('charts.legend.toggleLegendButtonAriaLabel', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ const Item = React.forwardRef<HTMLDivElement, Props>(
const expandPanel = expandedPanelId !== undefined && expandedPanelId === id;
const hidePanel = expandedPanelId !== undefined && expandedPanelId !== id;
const classes = classNames({
// eslint-disable-next-line @typescript-eslint/naming-convention
'dshDashboardGrid__item--expanded': expandPanel,
// eslint-disable-next-line @typescript-eslint/naming-convention
'dshDashboardGrid__item--hidden': hidePanel,
// eslint-disable-next-line @typescript-eslint/naming-convention
printViewport__vis: container.getInput().viewMode === ViewMode.PRINT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ export const QueryBarTopRow = React.memo(
}

const wrapperClasses = classNames('kbnQueryBar__datePickerWrapper', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'kbnQueryBar__datePickerWrapper-isHidden': isQueryInputFocused,
});

Expand Down
1 change: 0 additions & 1 deletion src/plugins/data/public/ui/search_bar/search_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ class SearchBarUI extends Component<SearchBarProps, State> {
let filterBar;
if (this.shouldRenderFilterBar()) {
const filterGroupClasses = classNames('globalFilterGroup__wrapper', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'globalFilterGroup__wrapper-isVisible': this.state.isFiltersVisible,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ export const Panel: React.FC<Props & React.HTMLProps<HTMLDivElement>> = ({
hasFooter: false,
});

/* eslint-disable @typescript-eslint/naming-convention */
const classes = classnames('fieldEditor__flyoutPanel', className, {
'fieldEditor__flyoutPanel--pageBackground': backgroundColor === 'euiPageBackground',
'fieldEditor__flyoutPanel--emptyShade': backgroundColor === 'euiEmptyShade',
'fieldEditor__flyoutPanel--leftBorder': border === 'left',
'fieldEditor__flyoutPanel--rightBorder': border === 'right',
'fieldEditor__flyoutPanel--withContent': config.hasContent,
});
/* eslint-enable @typescript-eslint/naming-convention */

const { addPanel } = useFlyoutPanelsContext();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ export const Panel: React.FC<Props & React.HTMLProps<HTMLDivElement>> = ({

const [styles, setStyles] = useState<CSSProperties>({});

/* eslint-disable @typescript-eslint/naming-convention */
const classes = classnames('fieldEditor__flyoutPanel', className, {
'fieldEditor__flyoutPanel--pageBackground': backgroundColor === 'euiPageBackground',
'fieldEditor__flyoutPanel--emptyShade': backgroundColor === 'euiEmptyShade',
'fieldEditor__flyoutPanel--leftBorder': border === 'left',
'fieldEditor__flyoutPanel--rightBorder': border === 'right',
'fieldEditor__flyoutPanel--withContent': config.hasContent,
});
/* eslint-enable @typescript-eslint/naming-convention */

const { addPanel } = useFlyoutPanelsContext();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ export const PreviewListItem: React.FC<Props> = ({

const [isPreviewImageModalVisible, setIsPreviewImageModalVisible] = useState(false);

/* eslint-disable @typescript-eslint/naming-convention */
const classes = classnames('indexPatternFieldEditor__previewFieldList__item', {
'indexPatternFieldEditor__previewFieldList__item--highlighted': isFromScript,
'indexPatternFieldEditor__previewFieldList__item--pinned': isPinned,
});
/* eslint-enable @typescript-eslint/naming-convention */

const doesContainImage = formattedValue?.includes('<img');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export function DiscoverGridDocumentToolbarBtn({
className={classNames({
// eslint-disable-next-line @typescript-eslint/naming-convention
euiDataGrid__controlBtn: true,
// eslint-disable-next-line @typescript-eslint/naming-convention
'euiDataGrid__controlBtn--active': isFilterActive,
})}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export const TableRow = ({
);
const [open, setOpen] = useState(false);
const docTableRowClassName = classNames('kbnDocTable__row', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'kbnDocTable__row--highlight': row.isAnchor,
});
const anchorDocTableRowSubj = row.isAnchor ? ' docTableAnchorRow' : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ export function PanelHeader({
const showPanelBar =
!isViewMode || badges.length > 0 || notifications.length > 0 || showTitle || description;
const classes = classNames('embPanel__header', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'embPanel__header--floater': !showPanelBar,
});
const placeholderTitle = i18n.translate('embeddableApi.panel.placeholderTitle', {
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/kibana_react/public/code_editor/code_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,9 @@ export const CodeEditor: React.FC<Props> = ({

const [isHintActive, setIsHintActive] = useState(true);

/* eslint-disable @typescript-eslint/naming-convention */
const promptClasses = classNames('kibanaCodeEditor__keyboardHint', {
'kibanaCodeEditor__keyboardHint--isInactive': !isHintActive,
});
/* eslint-enable @typescript-eslint/naming-convention */

const _updateDimensions = useCallback(() => {
_editor.current?.layout();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export const withSolutionNav = (WrappedComponent: ComponentType<KibanaPageTempla
const sideBarClasses = classNames(
'kbnPageTemplate__pageSideBar',
{
// eslint-disable-next-line @typescript-eslint/naming-convention
'kbnPageTemplate__pageSideBar--shrink':
isMediumBreakpoint || (isLargerBreakpoint && !isSideNavOpenOnDesktop),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
},
// eslint-disable-next-line @typescript-eslint/naming-convention
'doc_table:hideTimeColumn': {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export interface UsageStats {
'notifications:lifetime:error': number;
'doc_table:highlight': boolean;
'discover:searchOnPageLoad': boolean;
// eslint-disable-next-line @typescript-eslint/naming-convention
'doc_table:hideTimeColumn': boolean;
'discover:sampleSize': number;
defaultColumns: string[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ export class VisLegend extends PureComponent<VisLegendProps, VisLegendState> {
type="button"
onClick={this.toggleLegend}
className={classNames('visLegend__toggle kbn-resetFocusState', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'visLegend__toggle--isOpen': open,
})}
aria-label={i18n.translate('visTypeVislib.vislib.legend.toggleLegendButtonAriaLabel', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export const ColumnChart: FC<Props> = ({
)}
<div
className={classNames('dataGridChart__legend', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'dataGridChart__legend--numeric': columnType.schema === 'number',
})}
data-test-subj={`${dataTestSubj}-legend`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ export function FieldEditor({
color={initialField.color}
iconSide="right"
className={classNames('gphFieldEditor__badge', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'gphFieldEditor__badge--disabled': isDisabled,
})}
onClickAriaLabel={badgeDescription}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export function FieldPicker({
<EuiBadge
data-test-subj="graph-add-field-button"
className={classNames('gphFieldPicker__button', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'gphFieldPicker__button--disabled': !hasFields,
})}
color="hollow"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,13 @@ export function GraphVisualization({
cy={node.ky}
r={node.scaledSize}
className={classNames('gphNode__circle', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'gphNode__circle--selected': node.isSelected,
})}
style={{ fill: node.color }}
/>
{node.icon && (
<text
className={classNames('fa gphNode__text', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'gphNode__text--inverse': isColorDark(...hexToRgb(node.color)),
})}
transform="translate(0,5)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ function ListItem({
// eslint-disable-next-line jsx-a11y/role-supports-aria-props
<li
className={classNames('gphGuidancePanel__item', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'gphGuidancePanel__item--disabled': state === 'disabled',
})}
aria-disabled={state === 'disabled'}
Expand All @@ -62,7 +61,6 @@ function ListItem({
{state !== 'disabled' && (
<span
className={classNames('gphGuidancePanel__itemIcon', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'gphGuidancePanel__itemIcon--done': state === 'done',
})}
aria-hidden={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ export function UrlTemplateForm(props: UrlTemplateFormProps) {
props.initialTemplate.icon && <LegacyIcon asListIcon icon={props.initialTemplate.icon} />
}
className={classNames('gphUrlTemplateList__accordion', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'gphUrlTemplateList__accordion--isOpen': open,
})}
buttonClassName="gphUrlTemplateList__accordionbutton"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ export const ComponentTemplates = ({ isLoading, components, listItemProps }: Pro
</div>
<div
className={classNames('eui-yScrollWithShadows componentTemplates__listWrapper', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'componentTemplates__listWrapper--is-empty': isSearchResultEmpty,
})}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ export const ComponentTemplatesSelector = ({
{/* Selection */}
<EuiFlexItem
className={classNames('componentTemplatesSelector__selection', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'componentTemplatesSelector__selection--is-empty': !hasSelection,
})}
data-test-subj="componentTemplatesSelection"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,8 @@ export const CreateField = React.memo(function CreateFieldComponent({
>
<div
className={classNames('mappingsEditor__createFieldWrapper', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__createFieldWrapper--toggle':
Boolean(maxNestedDepth) && maxNestedDepth! > 0,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__createFieldWrapper--multiField': isMultiField,
})}
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ function FieldListItemComponent(
return (
<li
className={classNames('mappingsEditor__fieldsListItem', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem--dottedLine': hasDottedLine,
})}
data-test-subj={`fieldsListItem ${dataTestSubj}`}
Expand All @@ -206,17 +205,13 @@ function FieldListItemComponent(
<div
style={{ paddingLeft: `${indent}px` }}
className={classNames('mappingsEditor__fieldsListItem__field', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__field--enabled': areActionButtonsVisible,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__field--highlighted': isHighlighted,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__field--dim': isDimmed,
})}
>
<div
className={classNames('mappingsEditor__fieldsListItem__wrapper', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__wrapper--indent':
treeDepth === 0 && maxNestedDepth === 0,
})}
Expand All @@ -225,11 +220,8 @@ function FieldListItemComponent(
gutterSize="s"
alignItems="center"
className={classNames('mappingsEditor__fieldsListItem__content', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__content--toggle': hasChildFields || hasMultiFields,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__content--multiField': isMultiField,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__content--indent':
!hasChildFields && !hasMultiFields && maxNestedDepth > treeDepth,
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,8 @@ export const SearchResultItem = React.memo(function FieldListItemFlatComponent({
<div className={classNames('mappingsEditor__fieldsListItem')} data-test-subj="fieldsListItem">
<div
className={classNames('mappingsEditor__fieldsListItem__field', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__field--enabled': areActionButtonsVisible,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__field--selected': isHighlighted,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__field--dim': isDimmed,
})}
>
Expand All @@ -104,9 +101,7 @@ export const SearchResultItem = React.memo(function FieldListItemFlatComponent({
gutterSize="s"
alignItems="center"
className={classNames('mappingsEditor__fieldsListItem__content', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__content--toggle': hasChildFields || hasMultiFields,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__content--multiField': isMultiField,
})}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,8 @@ function RuntimeFieldsListItemComponent(
<li className="mappingsEditor__fieldsListItem" data-test-subj="runtimeFieldsListItem">
<div
className={classNames('mappingsEditor__fieldsListItem__field', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__field--enabled': areActionButtonsVisible,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__field--highlighted': isHighlighted,
// eslint-disable-next-line @typescript-eslint/naming-convention
'mappingsEditor__fieldsListItem__field--dim': isDimmed,
})}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const ContextMenu: FunctionComponent<Props> = (props) => {
const [isOpen, setIsOpen] = useState<boolean>(false);

const containerClasses = classNames({
// eslint-disable-next-line @typescript-eslint/naming-convention
'pipelineProcessorsEditor__item--displayNone': hidden,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function _InlineTextInput({
const [textValue, setTextValue] = useState<string>(() => text ?? '');

const containerClasses = classNames('pipelineProcessorsEditor__item__textContainer', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'pipelineProcessorsEditor__item__textContainer--notEditing': !isShowingTextInput && !disabled,
});

Expand Down
Loading

0 comments on commit 8cd75df

Please sign in to comment.