Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need option '--decorators=true' thrown when transforming action(function) {}) #229

Open
mehulkar opened this issue Nov 22, 2019 · 6 comments

Comments

@mehulkar
Copy link

With a pretty vanilla run of this codemod, I saw these errors in the logs:

Transform not supported - need option '--decorators=true' or the property type CallExpression can not be transformed

Each of them (I only checked the first few) seems to be pointing to a function that is defined using the action import. E.g.:

export default Component.extend({
  foo: action(function() {
    // 
  });
})
@lelea2
Copy link

lelea2 commented May 27, 2020

i also ran to the same issue, with

export default Controller.extend({
  foo: new Date().getFullYear().toString()
})

which seems result from the same line of logic

,

@jaydgruber
Copy link

I just hit the same with:

export default Controller.extend({
  endPeriodYear: new Date().getFullYear(),
});
2020-07-02T01:16:43.311Z [warn] [cup-client/app/controllers/returns/history/list.js]: FAILURE 
Validation errors: 
	[endPeriodYear]: Transform not supported - need option '--decorators=true' or the property type CallExpression can not be transformed

@wynnerd
Copy link

wynnerd commented Oct 28, 2021

Was there every a resolution to this? It basically negates the usefulness of this codemod for me as I have properties like this on pretty much every route / controller

@wynnerd
Copy link

wynnerd commented Oct 29, 2021

I think it would be really helpful to know what

is checking for?
Removing that last check just does what I was originally expecting this codemod to do!

@eelke
Copy link

eelke commented Nov 3, 2021

Same issue here, even though the 'no-actions-hash' eslint rule dictates that this is the correct way of wiring up actions, any classic class that uses it gets skipped during the codemod.

Use the @action decorator or foo: action(function() {})) syntax instead of an actions hash.

https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-actions-hash.md

2021-11-03T12:28:49.559Z [warn] [./app/pods/components/animated-line/component.js]: FAILURE Validation errors: [stage]: Transform not supported - need option '--decorators=true' or the property type CallExpression can not be transformed [points]: Transform not supported - need option '--decorators=true' or the property type CallExpression can not be transformed

@arthur5005
Copy link

Hmm I have almost 1000 of this style of action decorator in the codebase. Anyone here find a good way of leveraging this code mod for individual who used action decorators in the ember classic style?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants