Ember.js V5 - Jquery Event

This automation removes all calls to originalEvent in case of accessing properties that work with jQuery events as well as native events.

Ember.js
jscodeshift
Estimated time saving
5 minutes/occurrence
Change mode
Autonomous
Applicability criteria

Ember.js version higher or equal to 3.3.

Made by
Rajasegar Chandran
Rajasegar Chandran

Usage →

Codemod CLI:

intalling vs code extension tooltip icon
codemod ember/5/jquery-event
copy CLI command icon

Codemod VS Code extension:

intalling vs code extension tooltip icon
vs code logo
Run in VS Code

Use/edit codemod in Codemod Studio:

intuita logo without text
Open in Codemod Studio

Description

Using event object APIs that are specific to jQuery.Event, such as originalEvent, is deprecated in Ember.js v3.3. This codemod removes all calls to originalEvent in case of accessing properties that work with jQuery events as well as native events.

Example

Before:

// your event handler:
export default Component.extend({
	click(event) {
		let x = event.originalEvent.clientX;
	},
});

After:

// your event handler:
export default Component.extend({
	click(event) {
		let x = event.clientX;
	},
});