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

Duplicate declarations #51

Closed
knownasilya opened this issue Jan 16, 2019 · 7 comments
Closed

Duplicate declarations #51

knownasilya opened this issue Jan 16, 2019 · 7 comments

Comments

@knownasilya
Copy link

Build Error (broccoli-persistent-filter:Babel > [Babel: mldp]) in mldp/account/action/controller.js

/Users/iradchenko/workspace/lma/src/MLDP.WebApp/mldp/account/action/controller.js: Duplicate declaration "Controller"
  3 | import { service } from "@ember-decorators/service";
  4 |
> 5 | export default class Controller extends Controller {
    |                      ^
  6 |   @service('notifications')
  7 |   notifications;
  8 |
@pzuraq
Copy link
Collaborator

pzuraq commented Jan 16, 2019

Ah, I don't think we handled pod/MU style declarations of names, @ssutar we definitely should add this functionality (also PRs definitely welcome! 😄)

@knownasilya
Copy link
Author

I'd contribute if I even understood how this thing worked. Where is the code? Haha!

@knownasilya
Copy link
Author

Looks like the code is here: https://github.com/scalvert/ember-es6-class-codemod/blob/master/transforms/helpers/parse-helper.js#L477

Do we have pods code anywhere? Will the testing layout need changes like mimicking pods?

@pzuraq
Copy link
Collaborator

pzuraq commented Jan 16, 2019

I don’t believe any pods code exists yet, and we definitely will need new tests/fixtures that mimic the pods structure. I think the new tests should be pretty straightforward, basically an input directory and output directory, though I’m not sure if our tests handle directories yet

@ssutar
Copy link
Contributor

ssutar commented Jan 16, 2019

@pzuraq Isn't this same as #49 where we would append the class type. So this would become

export default class ControllerController extends Controller

which is not a good name but is valid

@pzuraq
Copy link
Collaborator

pzuraq commented Jan 16, 2019

In the pods/MU style, the information is one level up, the folder name that contains the file:

/MLDP.WebApp/mldp/account/action/controller.js:

Should output:

export default ActionController extends Controller {}

I think folks may want this to be even less generic, like AccountActionController, but I don't think that's something we can automate, so probably just the single enclosing folder is the best thing to add to the class name.

@pzuraq
Copy link
Collaborator

pzuraq commented Aug 16, 2019

This should be fixed on master, let us know if you're still having issues!

@pzuraq pzuraq closed this as completed Aug 16, 2019
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

Successfully merging a pull request may close this issue.

3 participants