Transform this.set('someProp', value)
to set(this, 'someProp', value)
and ensure import of
import { set } from "@ember/object";
npx lil-codemods run set path/of/files/ or/some**/*glob.js
# or
yarn global add lil-codemods
lil-codemods run set path/of/files/ or/some**/*glob.js
Input (basic.input.js):
import { get } from "@ember/object";
function hello() {
this.set("whyNot", "1");
const okay = 1;
this.set("okay", okay);
}
Output (basic.output.js):
import { get, set } from "@ember/object";
function hello() {
set(this, "whyNot", "1");
const okay = 1;
set(this, "okay", okay);
}