This TSLint error can occur when creating objects, f.e. a popoverController in Ionic:
TSLint: Expected property shorthand in object literal ('{type}').(object-literal-shorthand)
async presentPopover(ev: any, type: string) {
const popover = await this.popoverController.create({
component: MaindropdownmenuComponent,
event: ev,
componentProps: {
onClick: () => {
popover.dismiss();
},
type
},
});
This error tells you that instead of type: type
, you can write only type
because the property name is the same as your const.
So this part becomes:
componentProps: {
onClick: () => {
popover.dismiss();
},
type
},