Skip to content

Latest commit

 

History

History
84 lines (60 loc) · 1.81 KB

File metadata and controls

84 lines (60 loc) · 1.81 KB

cleanup-imports

Usage

npx @freshworks/ember-codemods cleanup-imports path/of/files/ or/some**/*glob.js

# or

yarn global add @freshworks/ember-codemods
@freshworks/ember-codemods cleanup-imports path/of/files/ or/some**/*glob.js

Input / Output


basic

Input (basic.input.js):

import { expect } from 'chai';
import { describe, it, context, beforeEach, afterEach, before, after } from 'mocha';
import { setupTest, setupWindowMock, setupApplicationTest } from '@freshdesk/test-helpers';
import { faker } from 'ember-cli-mirage';
import { run } from '@ember/runloop';
import {
  SWITCHER_OPTIONS as switcherOptions
} from 'freshdesk/constants/automations';

let name = faker.name.firstName();

describe('Integration | Component test', function() {
  let hooks;
  hooks = setupTest();

  switcherOptions();

  // ...
});

describe('Integration | Component test', function() {
  let hooks, router, route, transitionTo;
  hooks = setupTest();

  // ...
});

Output (basic.output.js):

import { describe } from 'mocha';
import { setupTest } from '@freshdesk/test-helpers';
import { faker } from 'ember-cli-mirage';
import {
  SWITCHER_OPTIONS as switcherOptions
} from 'freshdesk/constants/automations';

let name = faker.name.firstName();

describe('Integration | Component test', function() {
  let hooks;
  hooks = setupTest();

  switcherOptions();

  // ...
});

describe('Integration | Component test', function() {
  let hooks, router, route, transitionTo;
  hooks = setupTest();

  // ...
});