Skip to content

Commit

Permalink
chore: update ESLint and fix new build error regarding it (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Aug 11, 2022
1 parent 53eddaf commit e8cd7f2
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 63 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"@types/jest": "^28.1.6",
"@types/moment": "^2.13.0",
"@types/node": "^18.6.1",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"cross-env": "^7.0.3",
"cypress": "^10.4.0",
"eslint": "^8.21.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/extensions/slickAutoTooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class SlickAutoTooltip {
maxToolTipLength: undefined,
replaceExisting: true
} as AutoTooltipOption;
pluginName: 'AutoTooltips' = 'AutoTooltips';
pluginName: 'AutoTooltips' = 'AutoTooltips' as const;

/** Constructor of the SlickGrid 3rd party plugin, it can optionally receive options */
constructor(options?: AutoTooltipOption) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class SlickCellExcelCopyManager {
protected _eventHandler: SlickEventHandler;
protected _grid!: SlickGrid;
protected _undoRedoBuffer!: EditUndoRedoBuffer;
pluginName = 'CellExcelCopyManager';
pluginName: 'CellExcelCopyManager' = 'CellExcelCopyManager' as const;

constructor() {
this._eventHandler = new Slick.EventHandler() as SlickEventHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class SlickCellExternalCopyManager {
protected _grid!: SlickGrid;
protected _onCopyInit?: () => void;
protected _onCopySuccess?: (rowCount: number) => void;
pluginName = 'CellExternalCopyManager';
pluginName: 'CellExternalCopyManager' = 'CellExternalCopyManager' as const;
onCopyCells = new Slick.Event();
onCopyCancelled = new Slick.Event();
onPasteCells = new Slick.Event();
Expand Down
5 changes: 1 addition & 4 deletions packages/common/src/extensions/slickCellMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class SlickCellMenu extends MenuFromCellBaseClass<CellMenu> {
autoAlignSideOffset: 0,
hideMenuOnScroll: true,
} as unknown as CellMenuOption;
pluginName: 'CellMenu' = 'CellMenu';
pluginName: 'CellMenu' = 'CellMenu' as const;

/** Constructor of the SlickGrid 3rd party plugin, it can optionally receive options */
constructor(
Expand Down Expand Up @@ -91,9 +91,6 @@ export class SlickCellMenu extends MenuFromCellBaseClass<CellMenu> {
// translate both command/option items (whichever is provided)
this.extensionUtility.translateMenuItemsFromTitleKey(columnCellMenuCommandItems);
this.extensionUtility.translateMenuItemsFromTitleKey(columnCellMenuOptionItems);

this.extensionUtility.translateItems(columnCellMenuCommandItems, 'titleKey', 'title');
this.extensionUtility.translateItems(columnCellMenuOptionItems, 'titleKey', 'title');
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/extensions/slickCellRangeDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class SlickCellRangeDecorator {
},
offset: { top: -1, left: -1, height: -2, width: -2 }
} as CellRangeDecoratorOption;
pluginName = 'CellRangeDecorator';
pluginName: 'CellRangeDecorator' = 'CellRangeDecorator' as const;

constructor(grid: SlickGrid, options?: Partial<CellRangeDecoratorOption>) {
this._addonOptions = deepMerge(this._defaults, options);
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/extensions/slickCellRangeSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class SlickCellRangeSelector {
border: '2px dashed blue'
}
} as CellRangeSelectorOption;
pluginName = 'CellRangeSelector';
pluginName: 'CellRangeSelector' = 'CellRangeSelector' as const;
onBeforeCellRangeSelected = new Slick.Event<{ row: number; cell: number; }>();
onCellRangeSelecting = new Slick.Event<{ range: CellRange; }>();
onCellRangeSelected = new Slick.Event<{ range: CellRange; }>();
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/extensions/slickCellSelectionModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class SlickCellSelectionModel {
selectActiveCell: true,
};
onSelectedRangesChanged = new Slick.Event<CellRange[]>();
pluginName = 'CellSelectionModel';
pluginName: 'CellSelectionModel' = 'CellSelectionModel' as const;

constructor(options?: { selectActiveCell: boolean; cellRangeSelector: SlickCellRangeSelector; }) {
this._eventHandler = new Slick.EventHandler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { BindingEventService } from '../services/bindingEvent.service';
declare const Slick: SlickNamespace;

export class SlickCheckboxSelectColumn<T = any> {
pluginName = 'CheckboxSelectColumn';
pluginName: 'CheckboxSelectColumn' = 'CheckboxSelectColumn' as const;
protected _defaults = {
columnId: '_checkbox_selector',
cssClass: null,
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/extensions/slickContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class SlickContextMenu extends MenuFromCellBaseClass<ContextMenu> {
optionShownOverColumnIds: [],
commandShownOverColumnIds: [],
} as unknown as ContextMenuOption;
pluginName: 'ContextMenu' = 'ContextMenu';
pluginName: 'ContextMenu' = 'ContextMenu' as const;

/** Constructor of the SlickGrid 3rd party plugin, it can optionally receive options */
constructor(
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/extensions/slickDraggableGrouping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class SlickDraggableGrouping {
} as DraggableGroupingOption;
columnsGroupBy: Column[] = [];
onGroupChanged: SlickEvent;
pluginName: 'DraggableGrouping' = 'DraggableGrouping';
pluginName: 'DraggableGrouping' = 'DraggableGrouping' as const;

/** Constructor of the SlickGrid 3rd party plugin, it can optionally receive options */
constructor(
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/extensions/slickHeaderButtons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class SlickHeaderButtons extends MenuBaseClass<HeaderButton> {
protected _defaults = {
buttonCssClass: 'slick-header-button',
} as HeaderButtonOption;
pluginName: 'HeaderButtons' = 'HeaderButtons';
pluginName: 'HeaderButtons' = 'HeaderButtons' as const;

/** Constructor of the SlickGrid 3rd party plugin, it can optionally receive options */
constructor(protected readonly extensionUtility: ExtensionUtility, protected readonly pubSubService: BasePubSubService, protected readonly sharedService: SharedService) {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/extensions/slickHeaderMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class SlickHeaderMenu extends MenuBaseClass<HeaderMenu> {
hideSortCommands: false,
title: '',
} as unknown as HeaderMenuOption;
pluginName: 'HeaderMenu' = 'HeaderMenu';
pluginName: 'HeaderMenu' = 'HeaderMenu' as const;

/** Constructor of the SlickGrid 3rd party plugin, it can optionally receive options */
constructor(
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/extensions/slickRowMoveManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class SlickRowMoveManager {
} as RowMoveManagerOption;
onBeforeMoveRows = new Slick.Event<{ grid: SlickGrid; rows: number[]; insertBefore: number; }>();
onMoveRows = new Slick.Event<{ grid: SlickGrid; rows: number[]; insertBefore: number; }>();
pluginName: 'RowMoveManager' = 'RowMoveManager';
pluginName: 'RowMoveManager' = 'RowMoveManager' as const;

/** Constructor of the SlickGrid 3rd party plugin, it can optionally receive options */
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/extensions/slickRowSelectionModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class SlickRowSelectionModel {
dragToSelect: false,
selectActiveRow: true
} as RowSelectionModelOption;
pluginName = 'RowSelectionModel';
pluginName: 'RowSelectionModel' = 'RowSelectionModel' as const;

/** triggered when selected ranges changes */
onSelectedRangesChanged = new Slick.Event();
Expand Down
2 changes: 1 addition & 1 deletion packages/custom-tooltip-plugin/src/slickCustomTooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class SlickCustomTooltip {
} as CustomTooltipOption;
protected _grid!: SlickGrid;
protected _eventHandler: SlickEventHandler;
name: 'CustomTooltip' = 'CustomTooltip';
name: 'CustomTooltip' = 'CustomTooltip' as const;

constructor() {
this._eventHandler = new Slick.EventHandler();
Expand Down
2 changes: 1 addition & 1 deletion packages/row-detail-view-plugin/src/slickRowDetailView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class SlickRowDetailView implements ExternalResource, UniversalRowDetailV
toolTip: '',
width: 30,
} as unknown as RowDetailView;
pluginName: 'RowDetailView' = 'RowDetailView';
pluginName: 'RowDetailView' = 'RowDetailView' as const;

/** Fired when the async response finished */
onAsyncEndUpdate = new Slick.Event();
Expand Down
84 changes: 42 additions & 42 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e8cd7f2

Please sign in to comment.