ember-concurrency-decorators-codemod
v0.1.0
Published
Codemod to refactor away existing `ember-concurrency-decorators` imports automatically
Downloads
2
Maintainers
Readme
ember-concurrency-decorators-codemod ·
As of ember-concurrency 2.0.0, the decorators provided by ember-concurrency-decorators
have been moved directly into ember-concurrency
, removing the need for this additional package.
This codemod refactors away existing ember-concurrency-decorators
imports automatically.
Prerequisites
- The target Ember app or addon must be using ember-concurrency >=2.0.0 in order for decorator imports to be available.
Usage
git clone https://github.com/camerondubas/ember-concurrency-decorators-codemod
npx jscodeshift -t ember-concurrency-decorators-codemod/refactor-imports.js <path/*glob>.js
Options
--quotes
: Whether to use 'single' or "double" quotes for strings. Default value: single
Examples
With ember-concurrency
import
Before:
import Component from '@glimmer/component';
import { timeout } from 'ember-concurrency';
import { dropTask, task } from 'ember-concurrency-decorators';
...
After:
import Component from '@glimmer/component';
import { timeout, dropTask, task } from 'ember-concurrency';
...
Withoutember-concurrency
import
Before:
import Component from '@glimmer/component';
import { dropTask, task } from 'ember-concurrency-decorators';
...
After:
import Component from '@glimmer/component';
import { dropTask, task } from 'ember-concurrency';
...
Testing
yarn test
Linting
yarn lint
License
This project is licensed under the MIT License.