Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 886 Bytes

README.md

File metadata and controls

47 lines (35 loc) · 886 Bytes

get

Transform this.get('someProp') to get(this, 'someProp') and ensure import of

import { get } from "@ember/object";

Usage

npx lil-codemods run get path/of/files/ or/some**/*glob.js

# or

yarn global add lil-codemods
lil-codemods run get path/of/files/ or/some**/*glob.js

Input / Output


basic

Input (basic.input.js):

function hello() {
  this.get("whyNot");
  const okay = this.get("okay");
}

Output (basic.output.js):

import { get } from "@ember/object";
function hello() {
  get(this, "whyNot");
  const okay = get(this, "okay");
}